Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash Creating help function

#!/bin/bash
############################################################
# Help                                                     #
############################################################
Help()
{
   # Display Help
   echo "Add description of the script functions here."
   echo
   echo "Syntax: scriptTemplate [-g|h|v|V]"
   echo "options:"
   echo "g     Print the GPL license notification."
   echo "h     Print this Help."
   echo "v     Verbose mode."
   echo "V     Print software version and exit."
   echo
}

############################################################
############################################################
# Main program                                             #
############################################################
############################################################
############################################################
# Process the input options. Add options as needed.        #
############################################################
# Get the options
while getopts ":h" option; do
   case $option in
      h) # display Help
         Help
         exit;;
     ?) # Invalid option
         echo "Error: Invalid option"
         exit;;
   esac
done


echo "hello world!"
Comment

bash help

man <cmd> 		# for manual of <cmd>, i.e. complete documentation
<cmd> --help  	# for optional parameters
<cmd> -h		# short version of help

apropos <keyword> 	# search for short description for matched instances
					# of the given keyword

apropos sudo		# an example
Comment

PREVIOUS NEXT
Code Example
Shell :: delete github credentials in windows 
Shell :: bash suppress error code 
Shell :: mac check command line tools version 
Shell :: print env variables 
Shell :: how to install multiple packages in one line of pip 
Shell :: ubuntu set current timezone asia/kolkata 
Shell :: how to add project to bitbucket 
Shell :: linux bin to iso 
Shell :: install specific node version linux 
Shell :: como instalar paquetes tar.gz en ubuntu 
Shell :: git remove file from history 
Shell :: linux shutdown 
Shell :: error: The following untracked working tree files would be overwritten by merge: static/platform_images/landing_page_img.png Please move or remove them before you merge. Aborting 
Shell :: installing git in ec2 
Shell :: nuget equivalent of npm install 
Shell :: yum install node version 12 
Shell :: HOW TO REPLACE A CHARACTER FROM A STRING IN BASH 
Shell :: install nginx mariadb php on mac 
Shell :: reinit git-submodules 
Shell :: get list of all branches github 
Shell :: install google chrome on ubuntu 
Shell :: pytorch for jetson nano 
Shell :: get file size in bash 
Shell :: powershell foreach 
Shell :: check gcc version 
Shell :: push code to github repository from command line 
Shell :: powershell write to file 
Shell :: wsl2 release memory 
Shell :: remove unnecessary npm packages 
Shell :: npm install less-loader 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =