I have this script
echo "\nEnter the password: \n"
read pword
echo "\nEnter the time to run ex. 1700: \c"
read time
echo "\nEnter the month to run ex. Dec: \c"
read month
echo "\nEnter the Day to run ex 09: \c"
read day
cd /usr/ias/tmp/"$pword"
rm I*;rm M*;rm G*;rm K*;rm H*;rm W*;rm *;
cd /usr/ias/bin
at "$time" nohup ht.make.lists "$pword">/dev/null &
This works fine, if the file exists in the tmp directory. But if there is no file, I get an error message. What I would like to do is create a statement that checks if the file exists, and if it does, then run the rm. If it doesn't, then I would just like to skip over this. I think it can be done with an if statement, but I don't know who to check if the file exists?
I hope I made sense.
Dodge20
echo "\nEnter the password: \n"
read pword
echo "\nEnter the time to run ex. 1700: \c"
read time
echo "\nEnter the month to run ex. Dec: \c"
read month
echo "\nEnter the Day to run ex 09: \c"
read day
cd /usr/ias/tmp/"$pword"
rm I*;rm M*;rm G*;rm K*;rm H*;rm W*;rm *;
cd /usr/ias/bin
at "$time" nohup ht.make.lists "$pword">/dev/null &
This works fine, if the file exists in the tmp directory. But if there is no file, I get an error message. What I would like to do is create a statement that checks if the file exists, and if it does, then run the rm. If it doesn't, then I would just like to skip over this. I think it can be done with an if statement, but I don't know who to check if the file exists?
I hope I made sense.
Dodge20