Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <3AAD16B1.5182D547@veritas.com>
Date: Mon, 12 Mar 2001 10:34:25 -0800
From: Bob McGowan <rmcgowan@veritas.com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Jerome BENOIT <JGMBenoit@Wanadoo.fr>
CC: cygwin@cygwin.com
Subject: Re: bug or feature: `eval' vs `#!'
References: <4.3.1.2.20010309113008.023c7720@pop.ma.ultranet.com> <3AA9658B.EABF16E1@Wanadoo.fr> <20010309202353.O6430@redhat.com> <3AA98C43.A4366B33@Wanadoo.fr>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

You might want to insert the #! line before the eval line, rather than replace it.  That way, the file will be executable but will also start in the same way as the
original.

Jerome BENOIT wrote:
> 
> Christopher Faylor wrote:
> >
> > 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.
> 
> I just want to port such scripts to Cygwin:
> I will replace the bad first line by an appropriate `#!' line.
> 
> Ciao,
> Jerome BENOIT
> 
> >
> > cgf
> >
> > --
> > Want to unsubscribe from this list?
> > Check out: http://cygwin.com/ml/#unsubscribe-simple
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

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

