News for hackers. Stuff that matters.
Re:OS X DNS cache reset script by coherentpony on Tuesday June 14, 2016 @11:51AM (#11902814)
It's good practice to include

    set -eu
    set -o pipefail
to avoid the default ON ERROR RESUME NEXT behaviour of bash.
Re:OS X DNS cache reset script by Macha on Tuesday June 14, 2016 @01:09PM (#11903461)
Is that behaviour not the point here? The script tries the first command,then the second if that fails,etc.
Re:OS X DNS cache reset script by _asummers on Tuesday June 14, 2016 @07:14PM (#11906118)
One should also create traps on exit, to revert the system to a good state in the event of pipefail.
Re:OS X DNS cache reset script by stonogo on Tuesday June 14, 2016 @11:59AM (#11902880)
Please stop with the cargo-cult shell scripting. That's not all those options do.
Re:OS X DNS cache reset script by Someone1234 on Tuesday June 14, 2016 @12:19PM (#11903071)
Perhaps an explanation would have been more constructive than an insult.
Re:OS X DNS cache reset script by stonogo on Tuesday June 14, 2016 @01:40PM (#11903759)
Yes, I owe an explanation, but the guy advocating pasting bash settings into every script doesn't.
Re:OS X DNS cache reset script by coldtea on Tuesday June 14, 2016 @06:22PM (#11905818)
He gave an explanation of what they do. It might be wrong, but you haven't given any alternative one.

Besides he is right, and those are useful additions to almost any script that you want to stop on error, undefined vars, etc.