BlackJack wrote:@emcsquirreled: Both scripts could be expressed more concise.
Edit: And instead of the first script you could use ``watch``:
Thank you! As I said in the first post, I have self-taught myself bash from a single reference book and trial-and-error. This is my first published script, so all the input and corrections are greatly appreciated. Apparently I had some bad habits forming, so it is good they got killed before they grew too far.
The new script should read like so (poll-gpio.sh is no longer necessary):
read-gpio-all.sh
Code: Select all
#!/bin/bash
for $counter in {0..7}
do
echo "pin $counter is $(gpio read $counter)"
done
And then you run it like so:
Command Line