Balazs_noob
March 20th, 2008, 08:34 AM
Hi guys
i would haves small problem with bash...
my task would be to locate a chat.txt file(there is only one)
in my home folder and change all joseph to joe and all
marry to zoe.
i made this:
find ./home/balazs -name "chat.txt" | xargs sed 's:joseph:joe:g' |sed 's:marry:zoe:g'>`find ./home/balazs -name "chat.txt"`
it works great when i write the result to the standard output
but it makes a blank file when try to redirect it back
into the original file
any help would be appreciated :)
Balázs
i would haves small problem with bash...
my task would be to locate a chat.txt file(there is only one)
in my home folder and change all joseph to joe and all
marry to zoe.
i made this:
find ./home/balazs -name "chat.txt" | xargs sed 's:joseph:joe:g' |sed 's:marry:zoe:g'>`find ./home/balazs -name "chat.txt"`
it works great when i write the result to the standard output
but it makes a blank file when try to redirect it back
into the original file
any help would be appreciated :)
Balázs