title: Need help to understand a shell script to set gpio pin on Raspberry Pi
body: <p>I have a script for a Raspberry Pi but I don't understand what is going on. I do know that its purpose should be to set GPIO19 to High, since the initial state after booting is Low or undefined respectively.</p>
  <pre><code>#!/bin/bash    
  for pin in 19; do
  /usr/bin/env gpio export ${pin} out
  chown -R pi /sys/class/gpio/gpio${pin}
  chmod -R g+w /sys/class/gpio/gpio${pin} done
  chown root.gpio /dev/gpiomem
  chmod g+rw /dev/gpiomem
  </code></pre>
  <p>I am not very familiar with Shell scripts, Raspbian and Raspberry Pi in general, so I would appreciate a line by line explanation. Thank you!</p>