The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-11-2009
family_guy family_guy is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 11
script to ask the user to select a number

hi all,

I have 4 scripts which i would need to run
1. BP.sh
2.DB.sh
3.LK.sh
4.TB.sh

I would like write a script which would ask the user to select a number from 1-4 accordingly and run only that script for him/her

I succeeded till reading the user input but not sure how to run that specific file ( lets say if user puts 2, then i need to run ./DB.sh)

echo " Please enter any one of the following values and press Enter"
echo "1 for BP"
echo "2 for DB"
echo "3 for LK"
echo "4 for TB"
echo "Enter value:"
read mInputValue
if ( $minputvalue = 1)
then......

Thanks in advance...