![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
|
Just playing
Although I've been using Linux for a while (in various forms - such as Slackware and Cygwin), I never got around to learning the likes of grep, sed and awk. That's what I've been doing over the past few days and today I noticed something with sed. I type the following:
$ sed -e '/mom/s/world/hull/g' h.txt Naturally, it replaces 'world' with 'hull' and prints the result out on the screen. However, when I try overwriting what's in the file by doing this: $ sed -e '/mom/s/world/hull/g' h.txt > h.txt it just wipes the file. What do I have to do to overwrite the contents of a file?
__________________
David Morris BSc.(Hons), MBCS Qualified Computer Engineer Administrator (SEED Software) |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| the video game. Burden on our future? | Eric the Red | Coder's Corner Lounge | 41 | Apr 5th, 2006 12:06 PM |
| Playing sounds in python? | j3ff86 | Python | 12 | Mar 30th, 2006 12:41 AM |
| how to run a video clip when user first run my software? | jesslee | Visual Basic .NET | 1 | Aug 7th, 2005 2:31 AM |
| Jackpot game | zorin | Visual Basic | 3 | Jun 10th, 2005 1:19 PM |