Shell stuff

From ihaveahax's Site
Jump to navigationJump to search

Some shell stuff I need to keep searching for.

Comparison

if [ abc = def ]; then
    echo "Valid"
fi

Arguments

if [[ $# -eq 0 ]]; then
    echo "No arguments"
fi

echo "First arg: $1"

for arg in "$@"; do
    echo "Arg: $arg"
done