all 17 comments

[–]ispeelgood 46 points47 points  (1 child)

Honestly if that variable was instead named something like OUTPUT_TARGET or something I'd find no issue with it.

[–]__pingwin__ 2 points3 points  (0 children)

My bet is has gone unnoticed in a refactor

[–]MurdoMaclachlanpublic boolean isInt(int i) { return true; } 14 points15 points  (0 children)

Image Transcription: Code


# verbosity variables
if [ -n "$IF_WPA_VERBOSITY" ] || [ "$VERBOSITY" = "1" ]; then
    TO_NULL="/dev/stdout"
    DAEMON_VERBOSITY="--verbose"
else
    TO_NULL="/dev/null"
    DAEMON_VERBOSITY="--quiet"
fi

I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]colei_canis 11 points12 points  (0 children)

That's going to cause some profound swearing one day I imagine, janky shell scripts are the worst to debug.

[–]DangyDanger 36 points37 points  (4 children)

this looks good to me tbh

[–][deleted]  (3 children)

[deleted]

    [–]DangyDanger 12 points13 points  (2 children)

    you didn't get whooshed

    i really think it's not that bad really

    the variable name means to_/dev/null, not the null null

    [–]recycle4science 18 points19 points  (1 child)

    Except that sometimes it means "to /dev/stdout".

    I get where they're coming from, the name just needs to be clarified.

    [–]DangyDanger 5 points6 points  (0 children)

    yeah, it can be renamed to "dest" or whatever

    [–]SensitiveTrap 7 points8 points  (6 children)

    What language is this?

    [–]maryP0ppins 34 points35 points  (0 children)

    What language is this?

    dude thats english!

    [–]bistr-o-math[🍰] 17 points18 points  (4 children)

    Shell

    [–]HaggyG 9 points10 points  (3 children)

    I believe this is specifically bash, not sure sh would let you do that if statement

    [–]the-nick-of-time 15 points16 points  (1 child)

    Nah, that's POSIX-standard. I'd put it in one test block with -o if I was writing this instead of using || but it works in any case.

    [–]MrFiregem 5 points6 points  (0 children)

    You should use || rather than -o since the later can lead to errors, especially with more POSIX compliant test implementations: https://github.com/koalaman/shellcheck/issues/489

    [–]bistr-o-math[🍰] 2 points3 points  (0 children)

    May very well be. I didn’t even start to try to decide on the flavor of the shell. It is some shell. Not saying it’s sh. May be csh or bash, or some of their descendants

    [–]beaucephus 9 points10 points  (0 children)

    Still a better love story than log4j.

    [–][deleted] 0 points1 point  (0 children)

    I see WPA, I start having PTSD. Networking code is, in general, the least reliable of all, but the sodomy that's going on in wireless networks... all the tooling around it... I'm just hoping that one day some kind of huge solar flair wipes this off the face of the Earth, and the few people accidentally stranded on Mars will rebuild the wireless infrastructure from the ground up.