1 minute read

Version v1.4 - Updated 2021-04-32
Run on Linux, Aix, MacOS

NAME - Using SADMIN shell menu template

SYNOPSIS [ -d 0-9 ] [ -h ] [ -v ]


The best way to become familiar the menu builder, is to run the “” script.

$ sudo $SADMIN/bin/

Menu template


Here is some portion of the code in “”, you want to modify to create your own menu.

# Display Main Menu     
while :
  sadm_display_heading "Your Menu Heading Here"               # Std SADMIN Menu Heading
  menu_array=("Your Menu Item 1" "Your Menu Item 2" "Your Menu Item 3" "Your Menu Item 4" )
  sadm_display_menu "${menu_array[@]}"                        # Display menu Array
  sadm_choice=$?                                              # Choice is returned in $?
  case $sadm_choice   in                                            
      1) sadm_mess "You press choice number $sadm_choice"
      2) sadm_mess "You press choice number $sadm_choice"
      3) sadm_mess "You press choice number $sadm_choice"
      4) sadm_mess "You press choice number $sadm_choice"
  99) # Option Quit -                                         # 99 = [Q],[q] was pressed
      break                                                   # Break out of the loop
      *) # Invalid Option #                                   # If an invalid key press
      sadm_mess "Invalid option"                              # Message to user


Options Description
-d [0-9] Set debug level from 0 to 9 (Default is 0)
-h Display this help and exit.
-v Output version information and exit.


  • The “$SADMIN” environment variable must be defined and contains the root directory of the SADMIN tools (normally /opt/sadmin). It should be already done, the setup script have updated the ‘/etc/profile.d/’ and the ‘/etc/environment’ files.
  • The SADMIN configuration file, is needed and loaded in memory at the beginning of every scripts. This file should already exist and contains your SADMIN configuration and preference setting.
  • For Shell script the Shell Library is used and for Python script the Python Library is used.


Exit Code Description
0 An exit status of zero indicates success.
1 Failure is indicated by a nonzero value, typically ‘1’.


Jacques Duplessis
Any suggestions or bug report can be submitted at the support page

Copyright © 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later
This is free software, you are free to change and redistribute it.
There is NO WARRANTY to the extent permitted by law.

SEE ALSO - Using SADMIN Shell script template - Using SADMIN Python script template