diff --git a/hello/world.sh b/hello/world.sh index 8bbf55f..9884602 100644 --- a/hello/world.sh +++ b/hello/world.sh @@ -1,4 +1,15 @@ #!/usr/bin/env bash echo "Hello world!" -echo "Remaining arguments: $@" + +if [ $# -gt 0 ]; then + echo "Got CLI arguments:" + for ((i = 1; i <= $#; ++i)); do + echo "$i: ${!i}" + done +fi + +if read -t 0 _; then + echo "Recieved stdin:" + cat +fi