Created
June 12, 2016 17:20
-
-
Save toxeus/10d6949dbb328c8a7668c76f71b77a6c to your computer and use it in GitHub Desktop.
How to create a interactive bash demo that does not need any typing.
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
#!/bin/bash | |
commands=( | |
"ls | head -n1" | |
"echo 44 55 | cut -d' ' -f1" | |
) | |
for c in "${commands[@]}"; do | |
read -p "\$ $c" | |
eval $c | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment