delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/08/22/18:15:31

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Will Parsons <oudeis AT nodomain DOT invalid>
Subject: Re: Looking for mkdirhier !
Date: Tue, 22 Aug 2006 21:12:24 +0000 (UTC)
Lines: 21
Message-ID: <slrneemspo.i33.oudeis@isis.thalatta>
References: <ecf9gi$eo1$1 AT sea DOT gmane DOT org> <013401c6c60f$44ed2880$a501a8c0 AT CAM DOT ARTIMI DOT COM> <ecff3t$66f$1 AT sea DOT gmane DOT org>
Reply-To: ellenophilos AT yahoo DOT com
User-Agent: slrn/0.9.8.1 (Debian)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019