wiki/help/linux/bash/script/argument.md

399 B

arguments.

all arguments.

local everything="$@" # all passed arguments.

script name.

local name="$0"           # name of a script.
local path=$(realpath $0) # full path to a script.

count.

local count="$#" # argument count.

slice.

local from2toEnd="${@:2}" # all arguments starting from 2nd.
# and the rest from array manipulations.