in reply to One to one file output idiom
I'm not good with one-liners, but this seems to do the job on Windows
>perl -pE"open OUT => qq(>$ARGV.ext); select (OUT); s/bla/drivel/" a b + c
C:\tmp\files>dir Datenträger in Laufwerk C: ist WINDOWS Volumeseriennummer: AE0B-3544 Verzeichnis von C:\tmp\files 15.01.2020 19:09 <DIR> . 15.01.2020 19:09 <DIR> .. 15.01.2020 18:51 12 a 15.01.2020 18:51 12 b 15.01.2020 18:51 12 c 3 Datei(en), 36 Bytes 2 Verzeichnis(se), 12.802.805.760 Bytes frei C:\tmp\files>perl -pE"open OUT => qq(>$ARGV.ext); select (OUT); s/bla/ +drivel/" a b c C:\tmp\files>type * a "bla bla" a.ext "drivel bla" b "bla bla" b.ext "drivel bla" c "bla bla" c.ext "drivel bla"
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: One to one file output idiom
by choroba (Cardinal) on Jan 15, 2020 at 18:19 UTC | |
by LanX (Saint) on Jan 15, 2020 at 18:26 UTC | |
by Eily (Monsignor) on Jan 16, 2020 at 09:28 UTC | |
by LanX (Saint) on Jan 16, 2020 at 20:34 UTC | |
by Eily (Monsignor) on Jan 17, 2020 at 08:57 UTC |