git @ Cat's Eye Technologies Dipple / master sh / test-args.sh
master

Tree @master (Download .tar.gz)

test-args.sh @masterraw · history · blame

#!/bin/sh

# SPDX-FileCopyrightText: Chris Pressey, the original author of this work, has dedicated it to the public domain.
# For more information, please refer to <https://unlicense.org/>
# SPDX-License-Identifier: Unlicense

# ./test-args.sh one two three
# ./test-args.sh one three
# ./test-args.sh one '' three

echo "ONE=[$1]"
echo "TWO=[$2]"
echo "THREE=[$3]"

if [ "$2" != "" ]; then
   echo "You supplied arg #2"
fi