Hi Guru's,
i am creating a script that will update menu of either complete or failed.
#!/bin/bash
choice=0
while [ $choice -ne 4 ]
do
echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""
echo " ###############################################"
echo " # Choose a script to run from the list below: #"
echo " # #"
echo " # 1) List files ${status} #"
echo " # 2) Copy ${status} #"
echo " # 3) run script ${status} #"
echo " # #"
echo " # 4) QUIT #"
echo " # #"
echo " ###############################################"
echo ""
read -p " Choice: " choice
case "$choice" in
1 ) ls -ltr
RET=$?
status=""
if [ $RET -gt 0 ]
then
status = "COMPLETE"
else
status = "FAILED"
fi
;;
2 ) cp -pv <file> <dest> ;;
3 ) ./runprog.sh ;;
4 ) clear; exit 1 ;;
*) exit;;
esac
clear
done
the output i am looking is that when return value is ZERO, it will display status COMPLETE on the MENU part else FAILED
EXPECTED OUTPUT
###############################################
# Choose a script to run from the list below: #
# #
# 1) Rename script COMPLETE #
# 2) Another script COMPLETE #
# 3) OneMore script FAILED #
# #
# 4) QUIT #
# #
###############################################
is this possible?
Cheers,
ME