Add slowcat script

This commit is contained in:
2023-01-29 20:04:24 +01:00
parent 09ea1617ce
commit b7abb8b811
2 changed files with 19 additions and 0 deletions

View File

@ -1,2 +1,13 @@
# slowcat
A very slow cat
## Examples
```
slowcat filename
( echo ab ; echo cd ; echo ef ; echo gh ) | slowcat
SLOWCAT_DELAY=.1 slowcat --help
timeout screen /dev/ttyUSB0 115200 ; SLOWCAT_DELAY=.05 slowcat filename > /dev/ttyUSB0
```

8
slowcat Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
cat "$@" | while IFS= LANG=C read -r -n1 -d '' a
do
printf %c "$a"
# echo "$a"
sleep ${SLOWCAT_DELAY:-.001}
done