Created
April 2, 2020 14:02
-
-
Save frojnd/ce5aef030c17f448d235fccb4a38cd85 to your computer and use it in GitHub Desktop.
This file contains 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 | |
function loop_through_tty { | |
log_path="$HOME/logs" | |
if [ ! -d "$log_path" ]; then | |
mkdir $log_path | |
fi | |
while true | |
do | |
mapfile -t ttys_path < <(find /dev/ -name "ttyUSB*") | |
for i in "${ttys_path[@]}"; do | |
printf "%s \n" "I found: $i" | |
echo ${i##*/} | |
picocom -b 115200 -l $i --logfile $log_path/picocom${i##*/}.log | |
done | |
done | |
} | |
loop_through_tty | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment