#!/bin/sh gpio_number=25 echo "${gpio_number}" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio${gpio_number}/direction echo "1" > /sys/class/gpio/gpio${gpio_number}/value sleep 5 echo "0" > /sys/class/gpio/gpio${gpio_number}/value echo "${gpio_number}" /sys/class/gpio/unexport
root@raspberrypi:/home/pi# sudo sh led.sh
25 /sys/class/gpio/unexport
期待通りに動きます。