Skip to content

Instantly share code, notes, and snippets.

@rrugge
Created May 9, 2017 21:35
Show Gist options
  • Save rrugge/ffecadca3b4a967f6d85dd5bde4926f1 to your computer and use it in GitHub Desktop.
Save rrugge/ffecadca3b4a967f6d85dd5bde4926f1 to your computer and use it in GitHub Desktop.
#!/bin/bash
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NOCOLOR='\033[0m'
filename="$1"
cat "$filename" | while read LINE
do
if [[ $LINE == \#* ]] ;
then
echo -e "${CYAN}$LINE ${NOCOLOR}"
read -s pause </dev/tty
else
echo -e "${GREEN}# $LINE ${NOCOLOR}"
eval "$LINE"
read pause </dev/tty
fi
done < "$filename"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment