Unix for Artists: Fun with FFMPEG is a workshop hosted by the Echo Park Film Center.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
unix4artists/bash/arguments.sh

22 lines
614 B

#!/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 <first> <second> <third> <etc>
#
#####################################################
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