Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
Created May 25, 2015 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PurpleBooth/30c599c8824106e863e5 to your computer and use it in GitHub Desktop.
Save PurpleBooth/30c599c8824106e863e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /to/a/directory
# make comments
run -what --you=would type.on -the commandline
VARIABLES_ARE_A_THING="youcanuse"
# sometimes you want conditionals
if [ $VARIABLES_ARE_A_THING -ne 0 ]
then
echo "you can output something too"
fi
for word in loops are a thing too do
echo $word
done
# you can capture output from commands like this
OUTPUT="$(ls -1)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment