EnderUNIX Team.


EnderUNIX tips

Mail to My Friend , Home Page

[ Shell Scripting ]

"Inserting lines within scripts - 2" - Ülkü SAYILAN - (2004-08-23 11:57:22)   [5167]

If you want to insert a line at the top (or anywhere for that matter) of a file within a shell script, use the ed editor.

EXAMPLE:

string="hello"
ed << EOF
e any_file
1i
${string}

Mail to My Friend , Home Page