Actually, my command did work after all. I was testing in one of my test directories and forgot that UNIX/Linux is case sensitive. The command '$ chgit leia anakin' could not work because the word was LEIA (uppercase).
So everything appears to be just fine.
Thanks again
The script that I created, 'chgit' would be used on the command line like this.
$ chgit leia anakin
leia is an example of the old phrase to be replaced.
anakin is an example of the new phrase to be used.
I am devising a method to send two values to a script that will does your command.
script name: cngit
perl -p -i -e 'BEGIN{@ARGV = grep -T, @ARGV} s|$1|$2|g' *
But it doesn't seem to be working. Any ideas
I am trying to do a global replacement of a value in a directory. The command I am using is
"perl -p -i -e 's|<old text>|<new text>|g' *"
This of course touches all files in the directory and I am getting errors on executable programs that it pass through. Is there a way to select just the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.