Created
June 18, 2017 00:40
-
-
Save ryaan-anthony/bf62c3d8af80d6b9ef1f71045d6bfcd4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
while read -p "> " line; do | |
if [[ $line == "log" ]]; then | |
exec >>log 2>&1 | |
fi | |
echo $line | |
exec &>$(tty) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment