Bash

miscellaneous bash notes and snippets

Set

-x

set -x allows for line by line output

example

set -x
echo Hi
echo Hello World

output

+ echo Hi
Hi
+ echo Hello World
Hello World

-eo Pipefail

exists script on a failure either internally or from a pipeline, good as a safety

Variables

backticks `` around a variable declaration will execute it as a command

name=`uname`
echo `$name
# output is result of uname command ex: "Linux"