Added stdin check to hello world script

This commit is contained in:
Random936
2025-09-30 21:34:33 -07:00
parent cd69ef9e7d
commit 30d1f61ed1

View File

@@ -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