Could someone tell me what does this reply mean ? sed: -e expression #1, char 4: unknown command: `'I get it when I use : sed -n $nump $javaFile >> ~/Desktop/$1_sql.txtfor i in `seq 5 $max`do    lineNum=$(($num + $i))    echo $lineNum    sed -n $lineNump $javaFile >> ~/Desktop/$1_sql.txtdoneWhere $javaFile is a java file and num is an integer.
sed: -e expression #1, char 4: unknown command:
sed;scripting
Your script is OK. It's the line terminator making it doesn't work, probably. You can check the line terminator withfile YourScriptFileIf it returns something like ...with CRLF line terminators, You can change CRLF to LF line terminator by usingflip -u YourScriptFileRun the script file again.P.S.There is a quick and dirty solution to your problemcut -d $'\n' -s -f ${num},$((num+5))-$((num+max)) $javaFile-d $'\n' means we are using \n as delimiter and -f ${num},$((num+5))-$((num+max)) means the fields(In this situation, lines) you wants. fields are a list, which can be 1-3, 1,3-10 etc.