You are not logged in.
Pages: 1
I would like to be able to pipe the output from locate and have sed modify the files locate finds. Is there anyway to do this?
Offline
Depending on what exactly you want, this might do the trick:
locate foo | xargs sed -ie 's/asdfasdf/fdsafdsafdsa/'
Offline
Or you can use a for loop:
for f in $(locate foo); do sed -i 'whatever' ${f}; done
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Just out of interest, what happens if you don't end it with "done"?
Double booting Arch Linux and Linux Mint
Reader of XKCD
Offline
No one can be told what would happen, you have to see it for yourself
Offline
Pages: 1