JP Vossen on 21 Feb 2011 22:05:47 -0800

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] bash 101 slides updated again, & info on why the #!/bin/bash -

At dinner after last night's PLUG W meeting, Eric pointed out that I forgot to mention that you need to add eXecute perms to a shell script before it will run or you'll get a permission denied error. Duh... Thanks Eric.

I also talked about the 'checkbashisms' script but can never remember the name of the package. It's "devscripts" in the Debian/Ubuntu repos. So:

1) aptitude install devscripts
2) "checkbashisms: check whether a /bin/sh script contains any common bash-specific constructs"

Updated slides at:

I didn't add this to the slides, but the explanation for adding the '-' to the shebang line is at:

And as I re-read that, I think it's probably moot on Linux, since Linux doesn't allow setuid shell scripts [1], but it's still a good habit just in case. And I guess it would apply to other interpreters, like Perl, since 'perl -d' is arguably interactive Perl...


JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --