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 -->
  #1 (permalink)  
Old 10-13-2008
llsmr777 llsmr777 is offline
Registered User
  
 

Join Date: May 2007
Posts: 58
Help can't get script to work how I need it to...

Hi thank you for anyone who responds.

Here is my script:

Code:
for i in `ls -1 | grep $1 | grep  $2`
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
echo mv $i DONE/$x
echo "Is this OK?"
read user_response

case $user_response in

"y"|"Y")
        mv $i DONE/$x
        echo mv $i DONE/$x;;
*)
        echo "No changes made ...";;

esac

done


The list it grabs is more than one file.
When i run this it asks me if "Is this OK?" for each file. I want it to just spit out the list then ask me, if I say yes, then i want it to move all the files it lists.

Thank you!!

Last edited by radoulov; 10-13-2008 at 04:07 PM.. Reason: added code tags