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}
Subscribe to:
Post Comments (Atom)
Blog Your Face on technology, history, reviews, magic the gathering and getting things done
No comments:
Post a Comment