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

bash command help

# EXAMPLE
man grep

# SYNTAX
man <command-to-get-help-on>
Comment

PREVIOUS NEXT
Code Example
Shell :: Download file from URL on Linux using command line 
Shell :: install dvc in ubuntu 
Shell :: set alias for directory in powershell 
Shell :: ionic icon dimensions 
Shell :: how to save changes made to models in django 
Shell :: git pull rebase command 
Shell :: nvmrc 
Shell :: anaconda for ubuntu 18.04 
Shell :: git rename a local branch 
Shell :: rmdir multiple directories 
Shell :: command to create jpeg in linux 
Shell :: github create a new repository on the command line 
Shell :: Add a Remote Repository in git command 
Shell :: shell get creation date of file 
Shell :: how to sudo pip permission denied 
Shell :: how to change the time in kali linux 
Shell :: bash script cheat sheet 
Shell :: vim brew 
Shell :: folder open command in linux 
Shell :: git hub 
Shell :: install virtualbox linux 
Shell :: how to create a text file list of the contents of a folder and subfolders 
Shell :: add environment variable linux 
Shell :: uninstall all pip packages anaconda 
Shell :: export function in shell script 
Shell :: git checkout master 
Shell :: reset git from last commit 
Shell :: join computer to domain powershell script 
Shell :: mountebank docker quick start 
Shell :: download from web linux bash 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =