I have this code in my shell(bash) script for splitting a file into smaller parts:
for (( i=$start; i<=$lineCount; i=i+$interval)) do temp=`expr $i + $int
Problem is here:
command="head -$temp $fileName | tail -$interval > $tmpFileName"
and later:
`$command`
Instead of storing whole piped command in a string you can directly execute the command:
head -$temp "$fileName" | tail -$interval > "$tmpFileName"