this post was submitted on 02 Dec 2025
83 points (100.0% liked)

Linux

10427 readers
751 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 2 years ago
MODERATORS
 

My primary use case for Amber is when I need to write a Bash script but don't remember the silly syntax. My most recent Bash mistake was misusing test -n and test -z. In Amber, I can just use something == "" or len(something) == 0

you are viewing a single comment's thread
view the rest of the comments
[โ€“] Samueru_sama@programming.dev 3 points 3 days ago (1 children)

My most recent Bash mistake was misusing test -n and test -z. In Amber, I can just use something == "" or len(something) == 0

test -n can be [ "$something" ] and test -z can be [ "$something" = "" ]

And this applies to posix shell, not just bash.

[โ€“] lens0021@programming.dev 1 points 2 days ago

Thank you for this comment. I'm revisiting this comment because I need to write this...

Comparing strings in a github actions workflow