Hey guys, i am about to throw it all in because i just cannot get this to work :S.
All i wanted to do is search through a file and find a string and replace with an argument from the command line.
So basically i have a file which has the contents of :
this is a test file
yes i am cool
say if i want to replace cool with $1 (which is 'crap', an argument from the shell) how do i accomplish this?
So far i have $1 = awk '/yes/ { print $4 }' file > file
I then want to overwrite the file with the updated contents. So the contents of file look like this:
this is a test file
yes i am crap
This just doesnt seem to do the job. If anyone knows please help!! i wont have any fingernails left soon :P thanks guys.