fd/screencast.sh
2018-01-28 12:59:27 +01:00

50 lines
No EOL
475 B
Bash

#!/bin/sh
set -e
PROMPT="▶"
enter() {
prompt
type $1
sleep 0.5
printf '%b' " ⏎\n"
eval $1
type "\n"
}
prompt() {
printf $PROMPT
type " "
}
type() {
printf '%b' $1 | pv -qL $[10+(-2 + RANDOM%5)]
}
main() {
IFS='%'
enter "fd"
enter "fd -e md"
enter "fd -e md --exec wc -l"
enter "fd mod"
enter "fd sh"
enter "fd -H sample"
enter "fd -h"
prompt
sleep 3
unset IFS
echo ""
}
main