Hello, On Tue, 09 Dec 2008, David C. Rankin wrote:
I haven't been able to find an easy way to make edits to multiple files from the command line without doing:
(sed or tr) -> tmpfile -> mv tmpfile original file.
What I'm looking for is a fast way to for is a fast way to edit an existing file directly and change one or two parameter. An example would be to edit all files in /etc/zypp/repo.d and change the keeppackages=0 to keeppackages=1 or something similar without having to use the copy and move, or having to edit the files one by one. Is there a way to do it?
perl -p -i -e 's/keeppackages=0/keeppackages=1/' FILENAMES You can get backups, by specifying an extension after '-i' (see perldoc perlrun for details). -dnh -- Sigmentation fault. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org