Last active
July 25, 2023 08:43
-
-
Save LeeTroy/24ae70eb7bcce065169d44cf10999b69 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INFILE=/dev/null | |
OUTFILE=/dev/null | |
function exists { | |
command -v $1 >/dev/null 2>&1 | |
} | |
while [ $# -gt 0 ]; do | |
case "$1" in | |
-i) | |
shift | |
INFILE="$1" | |
;; | |
-o) | |
shift | |
OUTFILE="$1" | |
;; | |
-h|--help) | |
echo "$0 -i infile -o outfile" | |
;; | |
*) | |
INFILE="$1" | |
esac | |
shift | |
done | |
cat << EOF | |
binary-xfer utility for minicom | |
Sending file ${INFILE} to ${OUTFILE} | |
EOF | |
if (exists pv); then | |
pv --force -i 0.25 -B 128 ${INFILE} 2>&1 > ${OUTFILE} | |
else | |
cat ${INFILE} > ${OUTFILE} | |
fi | |
cat << EOF | |
File transfer complete | |
EOF | |
# sleep 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Machine-generated file - use "minicom -s" to change parameters. | |
pu pname10 YUYNNbin-xfer | |
pu pprog10 /usr/bin/bin-xfer -o %l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment