Search Results

Search: Posts Made By: jyang72211
1,964
Posted By ahamed101
root@bt> cat fileA Linux Unix Solaris Windows ...
root@bt> cat fileA
Linux Unix Solaris Windows
root@bt> cat fileC
Windows
root@bt> cat fileD
Oops

root@bt> sed "s/$(<fileC)/$(<fileD)/g" fileA
Linux Unix Solaris Oops
Storing it in fileB
...
1,964
Posted By tukuyomi
Which system are you using? UNIX tool behave...
Which system are you using? UNIX tool behave differently between systems

I think you're missing the last slash. And if your sed takes files as argument, the `<` is useless:
sed...
1,964
Posted By greet_sed
1) sed -i s/search/replace/' fileA 2)...
1)
sed -i s/search/replace/' fileA

2) Assume that fileC, fileD contains just one string.
try this:
TO_GREP=`cat fileC`
TO_REP=`cat fileD`
sed "s/$TO_GREP/$TO_REP/" fileA
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 05:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy