started new thread
https://www.unix.com/shell-programmin...g-problem.html
New problem:
when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key
Iknow its probably something simple can anyone help?
here is my pause function: function pause(){
read -s -n 1 -p "Press any key to return to Menu . . ."
echo
}
SCRIPT CODE
echo "Enter file name: "
read fname;
if [ -f $fname ]; then
echo "$fname found"
else
echo "$fname not found"
pause
fi
echo "Enter directory for file to be copied to: "
read dname;
if [ -d $dname ]; then
cp $fname $dname
echo "file copied"
sleep 5
else
echo "$dname not found"
sleep 5
fi;;