195
you are viewing a single comment's thread
view the rest of the comments
[-] Tangentism@lemmy.ml 3 points 1 month ago

You could write that as 1 line:

[ -z "$var" ] && echo "empty" || echo "no it aint"

[-] barubary@infosec.exchange 4 points 1 month ago

@Tangentism @Ephera Did you mean:

echo "${var:-empty}${var:+no it aint}"

?

this post was submitted on 05 Mar 2025
195 points (99.5% liked)

Programmer Humor

34831 readers
153 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS