![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't alter bootlist | mooshkie | AIX | 2 | 01-28-2008 07:12 AM |
| Alter Table Shell Script | ankitgupta | Shell Programming and Scripting | 2 | 10-06-2006 03:01 AM |
| To alter perl /bin/date output by - 5 hours | Texan | Shell Programming and Scripting | 2 | 08-17-2005 05:28 AM |
| Turning off MMDF permanently | QmanV2 | UNIX for Dummies Questions & Answers | 4 | 07-07-2003 01:44 PM |
| Unmounting /home Permanently | alfabetman | UNIX for Dummies Questions & Answers | 8 | 03-21-2003 07:43 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
hi ,
m new to sed and awk. can anyone tell me how to alter the old file permanenetly using sed. e.g. $sed 's/cat/dog/g' old_file the above command will replace all the occrance of cat by dog in the file called old_file and by default will show the output at stdout. so is there anyway of altering the same "old_file" with sed. plz reply soon, bye |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
possible with -i option of sed
its GNU version of sed please search the forum; it had been answered many times |
|
#3
|
|||
|
|||
|
thnks buddy,
ya its working.can u also tel me how to remove the header from that same file i.e. i did $ sed -i 's/cat/dog/g' old_file the above is replacing cat to dog from the file called old_file,can i also remove the 1st line from the same file (old_file) simultaneously? thanks in advance |
|||
| Google The UNIX and Linux Forums |