You are not logged in.
Pages: 1
Hi,
I want to use sed to modify a source file. I use sed so that I can integrate it into a PKGBUILD.
I use this command :
sed -e 's/NEW_RESIZE_CODE 1/NEW_RESIZE_CODE 0/' guiconfig.h
It does exactly what I want. But now I want to directly modify the file and overwrite its content so I do :
sed -e 's/NEW_RESIZE_CODE 1/NEW_RESIZE_CODE 0/' guiconfig.h > guiconfig.h
But when I open the file, it is empty ! Note that it works if I use a different filename than the original input filename !!!
Any idea ?
Last edited by Bapman (2008-04-30 18:57:21)
Offline
try:
sed -i 's/NEW_RESIZE_CODE 1/NEW_RESIZE_CODE 0/' guiconfig.h
Haven't been here in a while. Still rocking Arch.
Offline
That's it ! Thanks a lot
Offline
You're welcome!
Haven't been here in a while. Still rocking Arch.
Offline
Heh I did the same thing recently whilst attempting to correct a typo in some schoolwork and wiped the file - luckily git came to the rescue.
Moral: backup files when playing with things you don't fully understand. Actually, backup files in general.
blog - github - facebook - google profile
Offline
Pages: 1