The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #4 (permalink)  
Old 05-30-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
  
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Sax,
See if this works for you.
Note that I commented the "cp" (copy) statement so that you can
make sure it does what you want first, before running it.
Code:
for mNewDir in `find /user/ -type d -name 'accu*'`
do
  mNewBase=`basename ${mNewDir}`
  mNewPriv=${mNewDir}"/private/"
  mOldPriv="/user/dotolds/"${mNewBase}".old/private/"
  echo "Now copying from "${mOldPriv}" to "${mNewPriv}
  #####cp ${mOldPriv} ${mNewPriv}
done

Last edited by Shell_Life; 05-30-2007 at 04:53 PM..