03 August 2015

1st line !#… => command interpreter path

#!/bin/bash

/etc/shells => available command interpreters

/bin/sh /bin/bash /bin/dash /bin/rbash

execute:

$ ./file.sh if executable => chmod +x file.sh
$ bash file.sh if not executable

commands

read variable
echo $variable
# comment

exit <return value>

read the return value

$?