The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #6 (permalink)  
Old 05-08-2007
TinWalrus TinWalrus is offline
Registered User
 

Join Date: May 2007
Posts: 27
you could do something like the following...

Code:
#!/bin/ksh
for file in $(find . -type f -exec grep -l sqlplus.*\@ {} \;); do
        echo ${file}
        sed -e 's%sqlplus user/pword@sid%sqlplus newuser/newpword@newsid%g' < ${file} > ${file}.$$
        mv ${file}.$$ ${file}
done
replace user, pword, sid with the current
replace newuser, newpword,newsid with replacement


run from parent directory, you should back up everything first

Last edited by TinWalrus; 05-08-2007 at 07:50 PM..
Reply With Quote