scripting

Bruce Dubbs bdubbs at swbell.net
Thu May 16 21:56:43 PDT 2002


Rob 'Feztaa' Park wrote:
> Alas! timothy bauscher spake thus:
> 
>>>don't know why I didn't think of it before:
>>>(NN is the number of lines you want to insert after)
>>>
>>>cat file |head -NN > file~ &&
>>>echo "new line" >> file~ &&
>>>diff file file~|grep "^<"|cut '-d ' -f2- >> file~ &&
>>>mv -f file~ file 

Actually, I would'nt use diff/grep/cut.  I'd use
let x=`wc -l file` - NN &&
tail $x file >> file~

Lots of ways to do things in Linux.  :)

   -- Bruce


-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list