• deadbeef79000@lemmy.nz
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    9 months ago

    Yes! But -u is for undefined variables. It won’t stop a defined variable with an empty value. E.g foo="".

    Also ? and :? have the advantage of telling you right then and there where the variable use is that it must be defined or not empty… having to trek back to (likely) the top of the script to check is easily forgotten.