-
Notifications
You must be signed in to change notification settings - Fork 3
/
termrecorder.sh
31 lines (30 loc) · 1.03 KB
/
termrecorder.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
#!/bin/bash
#==============================================#
# Caligula's terminal recorder script. #
#==============================================#
mkdir -p ~/TermRecordings
printf "\n"
while true
do
read -p " Record terminal session? [y/n]: " answer
case $answer in
[yY]* ) read -p " Filename to record to (will be appended): " name
filename=~/TermRecordings/$name"_record.txt"
touch $filename
timingfile=~/TermRecordings/$name"_timing.txt"
touch $timingfile
printf "\n"
echo " Record filename is: " $filename
echo " Timing filename is: " $timingfile
printf "\n"
timestamp=$(date +%Y/%m/%d)' '$(date +%H:%M:%S)
echo " Timestamp:" $timestamp
echo " Now recording, type 'exit' when finished."
printf "\n"
script -q -a $filename --timing=$timingfile
break;;
[nN]* ) printf "\n"
exit;;
* ) echo " Enter Yes or No.";;
esac
done