"Kim Emax" <news@remove-emax.dk> writes:
> "Jacob Bunk Nielsen" <spam@bunk.cc> wrote
>
>> find . -type f|xargs perl -i -pe 's/foo/bar/gi'
>
> g er greedy, men hvad gør i? Ignore case?
Fra perlrun(1):
,----
| -i[extension]
| specifies that files processed by the "<>" construct are to be
| edited in-place. It does this by renaming the input file,
| opening the output file by the origi- nal name, and selecting
| that output file as the default for print() statements. The
| extension, if supplied, is used to modify the name of the old
| file to make a backup copy, following these rules: [ ... ]
`----
> Du må gerne lige forklare -i -pe, hvis du har tid
Igen, fra perlrun(1):
,----
| -p causes Perl to assume the following loop around your
| program, which makes it iterate over filename argu-
| ments somewhat like sed:
|
| LINE:
| while (<>) {
| ... # your program goes here
| } continue {
| print or die "-p destination: $!\n";
| }
| [ ... ]
`----
You guess where it came from:
,----
| -e commandline
| may be used to enter one line of program. If -e is given,
| Perl will not look for a filename in the argu- ment list.
| Multiple -e commands may be given to build up a multi-line
| script. Make sure to use semi- colons where you would in a
| normal program.
`----
--
Jacob -
www.bunk.cc
I can resist anything but temptation.