Mail Archives: cygwin/2006/08/22/18:15:31
mwoehlke wrote:
> [snip]
>
> Actually, I intentionally did not use a shebang... 'mkdir -p "$@"'
> should work on any Bourne-like shell, although in this case '#!/bin/sh'
> should suffice.
>
> I'm used to writing portable scripts; anything other than '#!/bin/sh' is
> very non-portable, and if the script needs to be run on Bourne+ (i.e.
> bash or ksh), then the only options are a: try to write a wrapper that
> invokes the script in bash/ksh as a here-doc (or something equally
> ugly), or b: don't use a shebang. I generally pick the latter.
I think this is a bad idea, since it breaks if run from csh/tcsh. I had
the experience not long ago of finding a bunch of scripts written by other
people getting errors when I ran them. This was a system running HP-UX
(where the Korn shell is the "standard" shell), and the lack of a shebang
didn't cause problems for other people, but I was using tcsh. (There are
those that like the Korn shell, but I'm not one of them.)
- Will
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -