#!/bin/bash -e ##################################################### # # Arguments are provided to commands and scripts usually # separated by a space. They can be read and used within # bash scripts by referencing them with the "$#" notation. # # Usage: bash bash/arguments.sh # ##################################################### echo "You entered \"$1\" as the first argument" # Using a slightly different notation if [ "${2}" != "" ]; then echo "You entered \"${2}\" as the second argument" fi if [ "${3}" != "" ]; then echo "All of the arguments you entered \"${@}\"" fi