The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM



Thread: sed usage
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-16-2008
capri_drm capri_drm is offline
Registered User
 

Join Date: May 2008
Location: St. Louis
Posts: 70
Era,
It works fine for only one file. I am passing the many file for that change from CLO* to CLO*_S02 .
Here is the code part

if [ ${source_schema} = 'OPSDM001' ]
then
sed -e 's/\(TSO[^"]*\)/\1_S02/g' $TN.${ecmdate}.sql > $tmpfile_cln
sed -e 's/"//g' $tmpfile_cln > $TN.${ecmdate}.sql
elif [ ${source_schema} = 'DAYA' ]
then
sed -e 's/\(TEST[^"]*\)/\1_S02/g' $TN.${ecmdate}.sql > $tmpfile_cln
sed -e 's/"//g' $tmpfile_cln > $TN.${ecmdate}.sql
elif [ ${source_schema} = 'CLODM001' ]
then
sed -e 's/\(IN CLO[^ ]*\)/\1_S02/g' $TN.${ecmdate}.sql > $tmpfile_cln
sed -e 's/"//g' $tmpfile_cln > $TN.${ecmdate}.sql
elif [ ${source_schema} = 'UHCDM001' ]
then
sed -e 's/\(TSHL[^"]*\)/\1_S02/g' $TN.${ecmdate}.sql > $tmpfile_cln
sed -e 's/"//g' $tmpfile_cln > $TN.${ecmdate}.sql
else
echo " hi "
fi

This script works fine for other schemas but CLODM001 is not working at all. Am I missing something here too ?

Thanks for yoor help !
Reply With Quote