(I wrote): >> I always thought the "colon-free" versions of the P.E. was a bash-ism, but >> experimentation shows that it works in "dash" as well. And "man dash" >> contains >> the following text:
>> In the parameter expansions shown previously, use of the colon in the >> format >> results in a test for a parameter that is unset or null; omission of the >> colon >> results in a test for a parameter that is only unset. >> So, is this POSIX, or just a dash-extension? (And Chet wrote): > The POSIX standard is freely available > https://pubs.opengroup.org/onlinepubs/9799919799/nfindex.html > and would answer your question. > https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_06_02 I don't read POSIX specs. I have people who read POSIX specs. Anyway, it is interesting that the colon-free version came first. That makes sense, given that that is how these things usually go - that is, the first syntax is the smallest possible (i.e., in this case, without the colon), then later revisions add to the existing syntax (i.e., adding in the colon). But the funny thing is that most of the documentation I've seen talks mostly about the colon form, and leaves the colon-free version as a small afterthought or footnote. And that confusion seems to be the root of why OP started this thread in the first place.