News for hackers. Stuff that matters.
Re:A shell colon does nothing. Use it anyway. by yjftsjthsd-h on Sunday July 26, 2026 @02:34AM (#49055372)
Agreed; author does note

> Why use the null-command when I could do VAR=${VAR:-default-value}?

and points out it's one less thing to typo, but that assumes the name is the same; I like e.g.

  TARGETFILE="${1:?need input file}"
  OPTIONALVAL="${2:-defaultvalue}"

There are no comments on this comment yet.