Originally Posted by adrianadonis
here is an example of a test file:
echo "this is the first command"
echo "this is the second command"
Also I just started to learn bash so anything you can give me to help me start off would be appreciated.
sed -n '2p' filename
this command will help you to get the line no. 2 from file. I will give you some basic idea.I hope it will help you.
x=`sed -n '2p' filename`
y=`sed -n '3p' filename`
echo "below is command-1,line no.2 output" >> OutputFilename
$x >> OutputFilename
echo "below is command-2,line no.3 output" >> OutputFilename
$y >> OutputFilename
And you can see the result by this