I have a script with 2 functions
1) show_menu
2) create
Ths show_menu function works fine....... Sort of....
When I select option 2 of the menu the code does a few commands and then calls another function called create. It's at this point that I get "create: not found".....
However, when I move this create function to the top of the script, it seems to work?
menu option 2 below:
2|z|Z)
#############################################
#
# Option 2 bla..bla....
# #############################################
echo "\nLooking for a ZFS pool or disks to create a ZFS pool..."
cat <<EOD
A ZFS pool is needed to store guest domain boot disks.
The following ZFS pools are available:
EOD
/usr/sbin/zpool list
USEZPOOLANSWER=`/usr/bin/ckyorn -p "Would you like to use one of ZFS pools listed for the guest domain boot disk?"`
if [ "${USEZPOOLANSWER}" = "y" ]
then
ZFSPOOLLIST=`/usr/sbin/zpool list -H |\
/usr/bin/awk '{print $1}'`
ZFSPOOL=`/usr/bin/ckitem -p "Please select which ZFS pool to use to store the boot disk for this guest domain:" ${ZF
SPOOLLIST}`
create
else
echo "Exiting."
exit
fi
#fi
exit
sleep 5
show_menu;;
So as you can see from the above code if I move the function create to the top of the script it will work, but if I move the function create to the end of the script I get the "create: not found"...
Thanks for any tips........