mac_g
asked on
Shell Script : find and replace the text inside files with extension *.mvc files in current directory
Shell script :
find and replace the text inside files with extension *.mvc files in current directory
curval --to be translate to - newval
find and replace the text inside files with extension *.mvc files in current directory
curval --to be translate to - newval
ASKER
it is working .. thank u
when to use -i option here ..
and also .. if the curval - is very complex with special chars within ..like --- "(/(test/*^^^'"232)|)"
in that, this may behave differently ..
please advice how to handle such cases .. and if there any space with the string ..
when to use -i option here ..
and also .. if the curval - is very complex with special chars within ..like --- "(/(test/*^^^'"232)|)"
in that, this may behave differently ..
please advice how to handle such cases .. and if there any space with the string ..
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
can please elaborate point . didn't get it..
2 - choose a 'separator' that will not be in the complex set - maybe @ in your case?..
2 - choose a 'separator' that will not be in the complex set - maybe @ in your case?..
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
before closing this thread .. can you please advice
if the
cur val is = abd@asd
new value = abd\@asdd
sed -i 's/abd@asd/abd\@asdd/g' 1.txt -- this is not working ..
if the
cur val is = abd@asd
new value = abd\@asdd
sed -i 's/abd@asd/abd\@asdd/g' 1.txt -- this is not working ..
ASKER
close this thread
sed -i 's/curval /newval/g' *.mvc
Try with one file first (testfile.mvc).