shell script $ {1: - "false"} meaning

a = ${1:-"false"}

$ 1: representatives passed the first argument.

If $ 1 exists and is not empty then a = $ 1, otherwise a = false;

: - a ternary operator.

$ 0: The name stands for execution of the script.

$ 2, $ 3, and so on behalf of a passed parameter.

$ # Represents the number of parameters.

$$ represents the current running process script ID ( PID)

$? Represents the completion of the execution result of an instruction.

Guess you like

Origin www.cnblogs.com/liuqd001/p/12002589.html