-
-
Save richiethomas/007060f8d5d72142abdd3ac7f8d7578b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ ! -t 0 ]; then | |
echo "Standard input is not a terminal. Reading input from non-interactive source." | |
cat > output.txt | |
else | |
echo "Standard input is a terminal. Waiting for user input interactively." | |
read -p "Enter your input: " user_input | |
echo "You entered: $user_input" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment