-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimation.sh
More file actions
108 lines (95 loc) · 1.61 KB
/
Animation.sh
File metadata and controls
108 lines (95 loc) · 1.61 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
# Function named animation is created to be called when ever animation is called.
animation(){
# Cat command followed by two less-than symbols will print what ever is in-between the two EOFs stands for end of file.
cat << EOF
o
-X-
...t....................
EOF
# Sleep for 1 second to get a slight pause between frames.
sleep 1
cat << EOF
o
-X-
t
.......................
EOF
sleep 1
cat << EOF
o
-X-
....t....................
EOF
sleep 1
cat << EOF
o
-X-
...t....................
EOF
sleep 1
cat << EOF
o
-X-
t
.......................
EOF
sleep 1
cat << EOF
o
-X-
....t....................
EOF
sleep 1
cat << EOF
o
-X-
...t....................
EOF
sleep 1
cat << EOF
o
-X-
t
.......................
EOF
sleep 1
cat << EOF
o
-X-
....t....................
EOF
sleep 1
cat << EOF
o
-X-
...t....................
EOF
sleep 1
cat << EOF
o
-X-
t
.......................
EOF
sleep 1
cat << EOF
o
-X-
....t....................
EOF
sleep 1
}
# I call the animation 3 times to make sure it goes for a long time since this is a example.
animation
animation
animation
# This is a little trick to keep the user from accidentally pressing ''enter'' during the animation.
# This would Give blank input to the next read. Witch would be bad. So 1-3 traps should be safe.
read -t .1 -n 1 dummytrap
read -t .1 -n 1 dummytrap
read -t .1 -n 1 dummytrap
# Just a read command to hold the user till enter is pressed.
read ani
# Exit command used at end to properly exit.
exit