[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sed:awk:perl::rock:paper:chainsaw [was Re: Using .XCompose]



I use perl as a "slightly better sed", in particular the following commands I just cut and paste and modify for use, for many years now, to do (multi-)file search and replace:

```
# simple version:
perl -p -i[.bak] -e 's/xxx/yyy/[g];' $(readlink somefile) # readlink is necessary do not clobber symlinks

# hierarchical "find", handle ALL possible interesting filenames, including those that won't display:
find target/dir -type f -print0 | xargs -0 perl -p -i[.bak] -e 's/xxx/yyy/[g];'
```

So I am a regular user of perl, and know almost nothing about it :)

Perl is really great, even though I only know literally how to "sed" with it, and nothing else.


Reply to: