The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Shell Noob
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-31-2007
Sax Sax is offline
Registered User
  
 

Join Date: May 2007
Posts: 8
Cheers, looks like just what i'm after, however I am getting a syntax error on line 5 (syntax error at line 5: `mNewPriv=$' unexpected), the only thing I have changed is the find (see below).

I have been through I a couple of time to check what I have typed in vi matches your solution, and I am sure I have typed it correctly.


Code:
for mNewDir in `find /user/ -type d -name 'accu*.old'`
do
  mNewBase=`basename ${mNewDir}`
  mNewPriv=${mNewDir}"/private/"
  mOldPriv="/user/dotolds/"${mNewBase}".old/private/"
  echo "Now copying from "${mOldPriv}" to "${mNewPriv}
  #####cp ${mOldPriv} ${mNewPriv}
done