Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d86f2cf6eb
Fetching contributors…

Cannot retrieve contributors at this time

executable file 29 lines (24 sloc) 0.519 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/bin/sh

fakeshell() {
echo
oldifs="$IFS"
IFS=""
read -p "$ " -r COMMAND
IFS="$oldifs"
if [ "$COMMAND" = "exit" ]; then exit; fi
OUTPUT="`eval "$COMMAND"`"
echo "$OUTPUT"
echo
}

BOLD="\033[1m"
NORMAL="\033[0m"

echo "Having a command print something out is fine if you want to read it now."
echo "What if you want to save it for later?"

OUTPUT=""
rm -f saved
touch saved
while [ "`cat saved`" != "1st thing" ]; do
printf "Try typing ${BOLD}echo \"1st thing\" > saved${NORMAL}.\n"
fakeshell
done

./step5
Something went wrong with that request. Please try again.