-
-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathtry.sh
More file actions
executable file
·48 lines (43 loc) · 886 Bytes
/
Copy pathtry.sh
File metadata and controls
executable file
·48 lines (43 loc) · 886 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash
#
# try.sh - script to demonstrate IOCCC entry 1991/fine
#
# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it
# this way allows us to have the user specify a different compiler in an easy
# way.
if [[ -z "$CC" ]]; then
CC="cc"
fi
make CC="$CC" all >/dev/null || exit 1
# clear screen to remove any compiler message to make the entry stand out more
clear
fine()
{
if [[ "$#" != 1 ]]; then
echo "$0: expected 1 arg, got $#" 1>&2
return
fi
read -r -n 1 -p "Press any key to run: echo $1 | ./fine: "
echo 1>&2
echo -n "$1 <-> "
echo "$1" | ./fine
echo 1>&2
}
fine "Green terra"
fine "Vex"
fine "Tang"
fine "Vend onyx"
fine "Cheryl be flashy"
fine "Rail"
fine "Clerk"
fine "Ones"
fine "Fur"
fine "Er"
fine "IV"
fine "NYC"
fine "Fubar"
fine "DQ"
fine "Off"
fine "Ire"
fine "PEP"
fine "The rug gary lenT"