-
Notifications
You must be signed in to change notification settings - Fork 3
/
termreplayer.sh
41 lines (38 loc) · 1.31 KB
/
termreplayer.sh
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
#!/bin/bash
#==============================================#
# Caligula's terminal replayer script. #
#==============================================#
if [ ! -d ~/TermRecordings ]; then
echo -e "\n The TermRecordings directory does not exist, no file can be replayed.\n"
exit
fi
printf "\n"
while true
do
read -p " Replay or Cat terminal session? [r/c/q]: " answer
case $answer in
[rR]* ) read -p " Filename to replay (leave unappended): " name
filename=~/TermRecordings/$name"_record.txt"
timingfile=~/TermRecordings/$name"_timing.txt"
printf "\n"
echo " Record filename is: " $filename
echo " Timing filename is: " $timingfile
printf "\n"
echo " Now replaying."
printf "\n"
scriptreplay $filename --timing=$timingfile
echo " Replay finished."
printf "\n"
break;;
[cC]* ) read -p " Filename to concatenate (leave unappended): " name
filename=~/TermRecordings/$name"_record.txt"
timingfile=~/TermRecordings/$name"_timing.txt"
printf "\n"
cat $filename
printf "\n"
exit;;
[qQ]* ) printf "\n"
exit;;
* ) echo " Enter Replay, Cat, or Quit.";;
esac
done