I'm amazed by this as well. A particular pet peeve of mine is a (for
instance) Perl script that looks like this:
$out = `cmd | grep foo | awk '{print $1}'| sed -e 's!baz!bar!g'`
Not only is this something that can be done entirely in Perl, but it's
something that can be done entirely in awk as well!
Furthermore, what's the chance that whoever wrote that actually has put the
shell into "pipefail" (or equivalent) mode and actually can check that any
of those chained commands failed?
Skylar
On Thu, May 12, 2016 at 9:21 PM, Dave Close <[email protected]> wrote:
> I am astounded by the number of non-bash scripts I've read that are
> nothing more than feel-good wrappers around a set of system() calls
> to get real work done. If you're using a scripting language because
> it enables you to write a "program" rather than just a series of calls,
> then /write/ a program. Otherwise stick to bash.
>
> Personally, I feel that, in any script, the fewer the exec() calls (of
> any type), the better. Processors may get faster but context changes
> still add up.
> --
> Dave Close, Compata, Irvine CA +1 714 434 7359
> [email protected] [email protected]
> "Arguing that you don't care about the right to privacy because you have
> nothing to hide is no different than saying you don't care about free
> speech because you have nothing to say." -- Edward Snowden
>
> _______________________________________________
> Tech mailing list
> [email protected]
> https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
> This list provided by the League of Professional System Administrators
> http://lopsa.org/
>
_______________________________________________
Tech mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
http://lopsa.org/