1. It is very helpful to describe the actual output you are getting, rather than just saying you're having an issue. An issue could mean that the text has weird whitespace, or the output is in Arabic, or that your computer is on fire.
2. After Perl's parsing, the shell sees (I believe):
Code:
echo "for i in `seq 0 99`; do" >> Neuron{value of $Num to Perl}.sh
Based on my quick testing, I expect the shell is then executing your seq command in place. Evidently bash is executing the section in backticks because it is inside double quotes, in the same way that it would perform variable interpolation inside double quotes. After playing with it a little, I expect this will solve that problem (not tested):
Code:
system("echo 'for i in `seq 0 99`; do' >> Neuron$Num.sh");
Disclaimer: I am not a bash programmer, and in fact think shell scripting is awful.
3. Why not just do this with Perl and avoid the pain of executing a shell script inside a Perl script?
Code:
open OUTPUT, ">> Neuron$Num.sh";
print OUTPUT 'for i in `seq 0 99`; do';
(I'm assuming you have a good reason for writing a .sh file, and are adding a newline later.)