Walid-Shouman
6/14/2017 - 6:52 PM

capture bash sessions

capture bash sessions

Terminology

  • script: Command for script recording.
  • scriptreplay: Commandfor script replay.
  • typescript: Default script output file.
  • timingfile: Default timing output file.

Note: we need both a timingfile and typescript file, as when we replay we need to know how long did every stroke take

Scenarios

Default

# Start recording
script 
# Keep on scripting
ls
ls -l
echo "test"
# Finish recording
exit
# Replay
scriptreplay

Previous scenario would result in having typescript and timingfile in the working directory, once we start scriptreplaying, contents of both files will be replayed.

Custom output files

# Start recording
script -tCustomTimingFile CustomTypeScript
# Keep on scripting then Finish
exit
# Replay
scriptreplay -t CustomTimingFile CustomTypeScript -d 4

Now we use CustomTimingFile instead of timingfile And we use CustomTypescript instead of typescript

Change the speed

# Start recording
script -tCustomTimingFile CustomTypeScriptFile
# Keep on scripting then Finish
exit
# Replay
scriptreplay -t CustomTimingFile CustomTypeScriptFile -d 4

Now we divide the speed with -d 4 to be four times the speed.