Hi ,
I am stuck up in the below scenario:-
I need to read a file name (eg A.txt) name frm another file (eg B.txt) and then I need to search for a particular expression in A.txt and substitute it with another expression.
How can I use SED inside SHELL Scripting and command prompt as well to execute the above problem.
The below is the script which I was trying to execute but I am not getting the desired O/P
++++++++++++++++++++++++++++++++++++++++++++++++
#!/bin/sh
FILE="$1"
echo ############################
echo $FILE
echo ############################
exec 3<&0
exec 0<$FILE
while read line
do
echo ############################
echo $line
echo ############################
FILE1="$line"
echo ############################
echo $FILE1
echo ############################
sed 's/feature\/frame\/work/vobs\/syscomp02\/comm\/work/' $FILE1
done
exec 0<&3
+++++++++++++++++++++++++++++++++++++++++++++++++++++
Where $1 is the input file which has the name of files to be edited.
Could someone please help?
Thanks in Advance,
SD.