Oh I'm sorry. I'm obviously clueless I know that!
here is my code
Code:
for i in `ls -1 | grep $1 | grep $2`
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
echo mv $i DONE/$x
done
echo "Is this OK?"
read user_response
case $user_response in
"y"|"Y")
mv $i DONE/$x
echo moved $i to DONE/$x;;
*)
echo "No changes made ...";;
esac
Code:
for i in `ls -1 | grep $1 | grep $2`
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
echo mv $i DONE/$x
done
Here i am compliing my list that I want to rename from .Sent to .Done
And then outputing it to the screen
Code:
echo "Is this OK?"
read user_response
Here I ask if what outputed was what the user wants to move
Code:
case $user_response in
"y"|"Y")
for i in `ls -1 | grep $1 | grep $2`
do
x=`echo $i | sed 's/\.Sent/\.Done/g'`
mv $i DONE/$x;;
*)
echo "No changes made ...";;
esac
Here I want the files to be moved from .Sent to .Done and then if the user says Y
and to print to screen "No changes made" if the user says no
When I run the script it lists all the files
then asks me if it's ok
when I hit Y
And I do a listing only 1 of the files listed were moved not all.
Thanks again.