Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
assafmo
on March 17, 2020
|
parent
|
context
|
favorite
| on:
Text Processing in the Shell
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: