main program is not calling small other programs

I am trying to understand a program in a book and this program suppose to call other programs which are in the same folder, the other programs are called 'lu' and 'add' but for some reason when it gets to the last line of each case to call these programs there is an error message saying

./rolo: line 29: lu: command not found  OR  
./rolo: line 29: add: command not found

and the lu program looks like this:

#!/bin/bash
#
# Look someone up in the phone book
#

grep "$1" phonebook

echo '
     would you like to:

            1. Look someone up
       2. Add someone to the phone book
       3. Remove someone from the phone book

       Please select one of the above (1 - 3): \c'

#
# Read and process selection
#

read choice
echo
case "$choice"
in
    1) echo "Enter name to look up: \c"
       read name
       lu "$name";;
    2) echo "Enter name to be added: \c"
       read name
       echo "Enter number: \c"
       read number
       add "$name" "$number";;
    *) echo "Bad choice";;
esac

I don't understand why is not calling them. Please any help is appreciated. Thank you.

1) do they have execution mode ( chmod +x lu add ) ?
2) if not try to call them like

bash lu "$name" ;;
bash add "$name" "$number" ;;

3) Or specify more info about their locations :

./lu "$name" ;;
./add "$name" "$number" ;;

4) or

PATH=$PATH:.
export $PATH

and then rerun your script

1 Like

Wow! this was very simple. Option 2) worked for me and I am sure that option 3) would work as well. Thank you very much Mr ctsgnb.