3 ms·
I use the following definition in my .profile to be able to replace foo with bar in all text files within a folder. replace() { grep -rl "$1" . | xargs
by hnarayanan 4y ago
I use the following definition in my .profile to be able to replace foo with bar in all text files within a folder.
replace() {
grep -rl "$1" . | xargs gsed -i "s/$1/$2/g"
}
Also, I run Spotify from the command line: https://github.com/hnarayanan/shpotify https://github.com/hnarayanan/shpotify
- marginalia_nu 4y ago> replace foo with bar in all text files within a folder. Jesus that foot-gun would make Bjarne Stroustrup blush.
- hnarayanan 4y agoWith great power comes great holes in feet.