Scripting: Calling Another Function

Hi Guys,

How to make a code/script which behaves like some kind of "front-end" then upon choosing from the options within it, it will call another script for that option. To make it clearer, let's say:

a. I have a first script which will list all the names of Students.
b. Then, once this script was run, it will provide an output list of the students, and will prompt something like "Choose a student to check for its profile".
c. Then after choosing from the list of students, say I choose from the list student John, it will call another function or just the same script will print a profile of John.

I hope you got it right. Please help, any suggestion would do.

Thanks!
rymnd_12345

Read about case statements.

$ cat test.sh
#! /bin/bash
x=$1
case $x in
    1) echo 1 ;;
    2) echo 2 ;;
    *) echo Get Lost; exit ;;
esac
$
$ ./test.sh 1
1
$ ./test.sh 2
2
$ ./test.sh 3
Get Lost
$