Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 33 lines (27 sloc) 0.739 kb
3142442 @singpolyma initial commit
authored
1 #!/bin/sh
2
3 fakeshell() {
4 echo
5 oldifs="$IFS"
6 IFS=""
7 read -p "$ " -r COMMAND
8 IFS="$oldifs"
9 if [ "$COMMAND" = "exit" ]; then exit; fi
10 OUTPUT="`eval "$COMMAND"`"
11 echo "$OUTPUT"
12 echo
13 }
14
15 BOLD="\033[1m"
16 NORMAL="\033[0m"
17
18 printf "Oh. It looks like our original output got erased. Whenever you use "
19 printf "the output redirection operator, it erases the file before putting "
20 printf "anything in it.\nLuckily, there is another operator, "
21 printf "${BOLD}>>${NORMAL}, which lets us add new output to a file.\n"
22
23 OUTPUT=""
24 while [ "$OUTPUT" != "2nd thing
25 1st thing" ]; do
26 printf "Try typing ${BOLD}echo \"1st thing\" >> saved${NORMAL}. "
27 printf "Then print the contents of ${BOLD}saved${NORMAL}.\n"
28 fakeshell
29 fakeshell
30 done
31
32 ./step8
Something went wrong with that request. Please try again.