News for hackers. Stuff that matters.
Re:Elegant Bash Conditionals by stonewareslord on Tuesday March 02, 2021 @10:51PM (#26324540)
Echo is defined differently in different shells ("not portable"). Also it can have arguments which breaks things sometimes:

    echo Option -n invalid # OK
    echo -n is not valid # Uh oh
    printf '%s ' -n is not valid # Always okay
Generally you should use printf because of its consistency. For a simpler example of OP's:

    panic() { printf '%s\n' "${0}: ${*}"; exit 1; }
Is fine. I don't see the need to pass a format string to your function. Just call:

    panic "${download_url}: unable to download"

There are no comments on this comment yet.