天天看點

shell變量預設值

${var:-string},${var:+string},${var:=string},${var:?string}

補充擴充:在上面這五種替換結構中string不一定是常值的,可用另外一個變量的值或是一種指令的輸出。