The UNIX and Linux Forums  

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-08-2007
Shell_Life's Avatar
Shell_Life Shell_Life is offline
Registered User
  
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Daemongk,
See if this works for you -- modify the output file as needed:

Code:
mYYYYMMDD=`date +"%Y%m%d"`
for mFile in /home/*
do
  mUserName=`echo $mFile | sed 's;.*/;;'`
  mNewFile=$mYYYYMMDD"_"$mUserName'.core'
  echo "mFile = "$mFile" mNewFile = "$mNewFile
  ###mv $mFile /temp/coremv
done


Last edited by Shell_Life; 06-08-2007 at 03:07 PM..