1 | #!/bin/bash |
2 | |
3 | ### empty string is false. Equivalent to -n. |
4 | test 'a' && echo true |
5 | test '' || echo false |
6 | # stdout-json: "true\nfalse\n" |
7 | |
8 | ### -n |
9 | test -n 'a' && echo true |
10 | test -n '' || echo false |
11 | # stdout-json: "true\nfalse\n" |