delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/09/20:24:21

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Fri, 9 Mar 2001 20:23:53 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: Cygnus <cygwin AT cygwin DOT com>
Subject: Re: bug or feature: `eval' vs `#!'
Message-ID: <20010309202353.O6430@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: Cygnus <cygwin AT cygwin DOT com>
References: <4 DOT 3 DOT 1 DOT 2 DOT 20010309113008 DOT 023c7720 AT pop DOT ma DOT ultranet DOT com> <3AA9658B DOT EABF16E1 AT Wanadoo DOT fr>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <3AA9658B.EABF16E1@Wanadoo.fr>; from JGMBenoit@Wanadoo.fr on Sat, Mar 10, 2001 at 12:21:47AM +0100

On Sat, Mar 10, 2001 at 12:21:47AM +0100, Jerome BENOIT wrote:
>
>
>> >Hello:
>> >
>> >Under Win98 script files with as first line
>> >
>> >eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl
>> >-S $0 $ argv:q'
>> >
>> >contrary to script files with bang mechanism (`#! <executable>')
>> >are not identify as executable (and we cannot set them executable with
>> >`chmod'),
>> >and therefore the completion mechanism does NOT work for them.
>> >
>> >
>> >
>> >Is it a bug or a feature ?
>> >
>> >Byebye,
>> >Jerome BENOIT
>> 
>> Shell scripts that don't start with !# are inherently non-portable.  See
>> 
>> Why doesn't my script work?
>> http://www.cygwin.com/faq/faq_toc.html#TOC39
>> 
>> in the FAQ.  Keep in mind, this is a great source of information for
>> issues/questions like these!
>
>The script works under Cygwin and its first line is said to be portable,
>hence my question.

And what heuristic would you apply to identify that the script was executable.
We try to be accomodating in cygwin, so we look for things like '#!' and ':'
at the beginning of a file to verify that a script is executable but
trying to parse the above is not something that I think makes sense.

You can, of course, use ntsec on Windows NT, if you want to have true
UNIX permissions.  That really is the best, and fastest way to get what
you want.

If you don't have NT, or are on a FAT partition, then

(drum roll, please)

Patches are gratefully considered.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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