Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Lately I've started to use Perl instead of sed for replacing text. Its regex support is much better IMO:

  cat a.txt | perl -pe 's/banana-(\d)/papaya-$1/g'
Or in-place:

  perl -i -pe 's/banana-(\d)/papaya-$1/g' a.txt


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: