一段語法詢問 - Linux

Table of Contents

#!/bin/bash

tmp=`mktmp /tmp/dialog.XXX`
def=text
a="input the password"
dialog --insecure --passwordbox "$a" 10 40 2>"tmp"
pwd=$(cat $tmp)
[ -z "$pwd" ] && pwd=$def
rm "$tmp"


請問上列 [ -z "$pwd" ] 的意思

--

All Comments

Olive avatarOlive2018-07-15
當pwd沒值時,把def存到pwd裡
John avatarJohn2018-07-16
https://tinyurl.com/yblnnq38 (If Statements的文件)