☆ Yσɠƚԋσʂ ☆ to Programmer [email protected]English • 2 months agoLike programming in bashlemmy.mlimagemessage-square26fedilinkarrow-up1189cross-posted to: [email protected]
arrow-up1189imageLike programming in bashlemmy.ml☆ Yσɠƚԋσʂ ☆ to Programmer [email protected]English • 2 months agomessage-square26fedilinkcross-posted to: [email protected]
minus-square@[email protected]linkfedilink3•1 month agoYou could write that as 1 line: [ -z "$var" ] && echo "empty" || echo "no it aint"
minus-squareOriel Jutty :hhHHHAAAH:linkfedilink4•1 month ago@Tangentism @Ephera Did you mean: echo "${var:-empty}${var:+no it aint}" ?
minus-squareOriel Jutty :hhHHHAAAH:linkfedilink6•1 month agoIncidentally, this is an anti-pattern: http://mywiki.wooledge.org/BashPitfalls#cmd1_.26.26_cmd2_.7C.7C_cmd3
You could write that as 1 line:
[ -z "$var" ] && echo "empty" || echo "no it aint"
@Tangentism @Ephera Did you mean:
?
Incidentally, this is an anti-pattern: http://mywiki.wooledge.org/BashPitfalls#cmd1_.26.26_cmd2_.7C.7C_cmd3