News for hackers. Stuff that matters.
Re:Shell Style Guide by raverbashing on Tuesday May 15, 2018 @10:53AM (#17074341)
Nobody cares about non-bash shells if they're not dealing with legacy systems. (And if you are, you have bigger problems)
Re:Shell Style Guide by Sir_Cmpwn on Tuesday May 15, 2018 @10:56AM (#17074371)
Wrong. *BSD are not legacy systems, and many Linux installs don't have Bash. On top of that, new systems can't really implement Bash (because bash is defined by the implementation) but could easily implement POSIX sh (because POSIX sh is defined by the standard).
Re:Shell Style Guide by raverbashing on Tuesday May 15, 2018 @11:44AM (#17074821)
Agreed with BSD, but they usually have bash. (And you usually can compile it for your legacy application - I have done this)

Though I agree that if you're doing something bash specific you're most likely doing something that would be done better using Python/Perl/Ruby, etc

Re:Shell Style Guide by gkya on Tuesday May 15, 2018 @11:19PM (#17079790)
Default *BSD installs do not have bash, it needs to be installed (IDK what DragonFly and TrueOS do, but FreeBSD, NetBSD and OpenBSD don't ship with it). They all have it in the ports trees though. Many distros use BusyBox (IIRC Alpine is one). And AFAIK Debian base only has dash at /bin/sh.

Preferably the complexity in a shell script should be mostly handled by the programs invoked in it. All it has to provide is variables, basic control flow, subshells, and maybe some globbing.