作者gecer (gecer)
看板Linux
標題[問題] 一段語法詢問
時間Fri Jul 13 20:02:24 2018
#!/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" ] 的意思
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.255.19.56
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Linux/M.1531483347.A.EDF.html
1F:推 filiaslayers: 當pwd沒值時,把def存到pwd裡 07/13 20:06