Hacker News new | ask | show | jobs
by Joker_vD 595 days ago
I'd rather both have this option and have it work reliably. It's ridiculous that

    export VAR=$(cmd1 | cmd2)
does not count as a pipefail when cmd1 or cmd2 fail but

    VAR=$(cmd1 | cmd2)
does, so the "correct" way to set an environment variable from a pipeline's output is actually

    VAR=$(cmd1 | cmd2)
    export VAR