Hi,
I have a script that copies a file from one directory to another and compiles it.
What I have now is a menu that calls functions and each function compiles the file.
I want to have a function that compiles the file at the end of the script if the user selects options 1-3 in the menu, but if the user selects the 4th option, the file will not be compiled.
Code:
#!/usr/bin/ksh
#-----------------------#
single_ntl()
#-----------------------#
(
#set -xv #debug mode
cp ~/fundtech/env/BM_UBB/GPPconfig_SINGLE.txt ~/fundtech/env/GPPconfig.ubb;
cd ~/fundtech/env/;
tmloadcf -y GPPconfig.ubb;
)
#-----------------------#
single_htl()
#-----------------------#
(
#set -xv #debug mode
cp ~/fundtech/env/BM_UBB/GPPconfig_SINGLE_HTL.txt ~/fundtech/env/GPPconfig.ubb;
cd ~/fundtech/env/;
tmloadcf -y GPPconfig.ubb;
)
#-----------------------#
big_ntl()
#-----------------------#
(
#set -xv #debug mode
cp ~/fundtech/env/BM_UBB/GPPconfig_BIG.txt ~/fundtech/env/GPPconfig.ubb;
cd ~/fundtech/env/;
tmloadcf -y GPPconfig.ubb;
)
#set -xv #debug mode
clear
echo "Please choose a GPPconfig file you want to use in this test:"
echo
PS3="Choose a number: "
select CHOICE in Single_NTL Single_HTL Big_NTL Quit
do
case $CHOICE in
"Single_NTL") single_ntl;exit;;
"Single_HTL") single_htl;exit;;
"Big_NTL") big_ntl;exit;;
Quit) exit;;
*) echo "\nInvalid Choice\n";;
esac
done
Thanks,
Amit