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

Programmer Humor

34449 readers
104 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] balsoft@lemmy.ml 10 points 2 weeks ago* (last edited 2 weeks ago)

Why -z? I have no idea.

From man test (note that [ <expr> ] is just sugar for test <expr>):

       -n STRING
              the length of STRING is nonzero

       -z STRING
              the length of STRING is zero

So, -z stands for Zero.

Hope this helps you remember it!