3
1
I am looking for a method to add a shebang #!/bin/csh -f to first line of my file , which is actually getting created by a another set of program, since this script is auto-created, it should run from bash, when user clicks some button in my tool. I tried using sed but it didn't work.
sed ' 1 s/.*/\#!/bin/csh -f/' filename.
and awk
awk 'NR==1{printf "%s %s\n", $0, "#!/bin/csh -f"}' filename
both of these commands returns following
/bin/csh is not an event.
Please suggest a better method.
Dan
tried escaping the
!
character in your attempts? as in\!
instead of plain!
– Xen2050 – 2015-10-27T10:11:19.997Thanks "Xen2050", i tried your suggestion and this works well.
sed '1 i#!/bin/csh -f' filename > out.txt – StarCoder17 – 2015-10-27T10:16:42.047
I'll toss it in an answer then – Xen2050 – 2015-10-27T10:21:32.843