This is a simple bash script, that took way to long to get correct, to unexport all the of exported gpio pins on your BeagleBone board at once.
1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/bash GPIO=/sys/class/gpio/* UEXT=/sys/class/gpio/unexport for file in $GPIO do if [[ $file =~ (.*)(gpio)([0-9]+) ]] then echo "unexporting gpio${BASH_REMATCH[3]}" echo "${BASH_REMATCH[3]}" > $UEXT fi done |