Showing posts with label zsh. Show all posts
Showing posts with label zsh. Show all posts

Friday, 20 September 2013

Zsh don't match

Not sure how I have lived without this

Match stuff (we all know this)
ls *.mkv

Dont match stuff
ls ^*.mkv

Wednesday, 23 January 2013

Global search and replace with sed

So today I needed to replace a few hundred href link in varying content today.  Here's my take on solving it. This works in zsh.  I think for bash you need to add the do and done parts of the for loop, i'm not sure.

for file in `grep -lR "href=\"\/static\/" .`; sudo sed -i -e 's/href=\"\/static\//href=\"\/applications\/static\//g' $file