Hello
I have one file that has one line in it. I have to transfer that line to the end of another file but add some numbers before that line and some number after it. So I do something like this:
Code:
whatever=`cat otherfile`
printf 2343 > newfile
printf $whatever >> newfile
echo 121 >> newfile
That works fine when otherfile has just one line. e.g:
22439999121 (if otherfile contains 9999)
But now the problem:
otherfile sometimes has two lines, e.g.
9999
8888
and what I want in newfile is this:
22439999121
22438888121
Any ideas how I can do that for more than one line?