in reply to Have perl replace a bunch of text in lots of files
You've not explained what you plan to alter in each file.
cheako@hades:~$ diff -u <(curl 'http://www.perlmonks.org/?abspart=1;di +splaytype=displaycode;node_id=1118669;part=1') <(curl 'http://www.per +lmonks.org/?abspart=1;displaytype=displaycode;node_id=1118669;part=2' +) --- /dev/fd/63 2015-03-04 14:06:27.032424647 -0600 +++ /dev/fd/62 2015-03-04 14:06:27.032424647 -0600 @@ -1,6 +1,4 @@ - -get system status: - +HOSTNAME # get system status Version: FortiGate-60D v5.0,build4459,140410 (GA) Virus-DB: 23.00950(2015-03-02 19:54) Extended DB: 23.00950(2015-03-02 19:53) @@ -24,4 +22,5 @@ Release Version Information: GA System time: Tue Mar 3 12:38:43 2015 --------------------------------------------------------------: +#HOSTNAME -----------------------------------: +
As for the simple part: rename
On UNIX like systems it does not matter if you are working with the file or not, I'm not sure if this was ever fixed in Windows. For portable code you can maintain a hash of files you will rename and process them all at the end.
As suggested, don't SLURP unless you have too.
|
|---|