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:
	http://www.jpsdomain.org/public/2011_bash_101.odp
	http://www.jpsdomain.org/public/2011_bash_101.pdf


I didn't add this to the slides, but the explanation for adding the '-' to the shebang line is at:
	http://www.faqs.org/faqs/unix-faq/faq/part4/section-7.html

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...


Thanks,
JP

[1] http://www.linuxjournal.com/article/7727?page=0,1
----------------------------|:::======|-------------------------------
JP Vossen, CISSP            |:::======|      http://bashcookbook.com/
My Account, My Opinions     |=========|      http://www.jpsdomain.org/
----------------------------|=========|-------------------------------
"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         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug