Hi,
I am creating sed commands based on input file that has some numbers in it.
When I run a the following command on command prompt, it gives me desired result.
[echo "sed -n '2,$ s/^\(.\{"$i"\}\)\(.*\)$/\1,\2/'"] i.e. value of the variable is replaced and a sed command is generated in a single line.
But when this is run inside a shell script using KSH, the output is generated in two lines.
[echo "sed -n '2,$ s/^\(.\{"$i"\}\)\(.*\)$/\1,\2/'">script1.sh]
script1.sh will read like below:-
sed '2,$ s/^\(.\{
12\}\)\(.*\)$/\1,\2/'
The input file that is being read to replace $i has records like
12_
8_
IFS in the shell script has been set to '_'
Please could someone help.