public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* bug or feature: `eval' vs `#!'
@ 2001-03-08 23:07 Jerome BENOIT
  2001-03-09  8:38 ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 6+ messages in thread
From: Jerome BENOIT @ 2001-03-08 23:07 UTC (permalink / raw)
  To: Cygnus

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


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bug or feature: `eval' vs `#!'
  2001-03-08 23:07 bug or feature: `eval' vs `#!' Jerome BENOIT
@ 2001-03-09  8:38 ` Larry Hall (RFK Partners, Inc)
  2001-03-09 15:22   ` Jerome BENOIT
  0 siblings, 1 reply; 6+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2001-03-09  8:38 UTC (permalink / raw)
  To: Jerome BENOIT, Cygnus

At 01:55 AM 3/9/2001, 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!



Larry Hall                              lhall@rfk.com
RFK Partners, Inc.                      http://www.rfk.com
118 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bug or feature: `eval' vs `#!'
  2001-03-09  8:38 ` Larry Hall (RFK Partners, Inc)
@ 2001-03-09 15:22   ` Jerome BENOIT
  2001-03-09 17:23     ` Christopher Faylor
  0 siblings, 1 reply; 6+ messages in thread
From: Jerome BENOIT @ 2001-03-09 15:22 UTC (permalink / raw)
  To: Larry Hall (RFK Partners, Inc); +Cc: Cygnus

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bug or feature: `eval' vs `#!'
  2001-03-09 15:22   ` Jerome BENOIT
@ 2001-03-09 17:23     ` Christopher Faylor
  2001-03-09 19:13       ` Jerome BENOIT
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Faylor @ 2001-03-09 17:23 UTC (permalink / raw)
  To: Cygnus

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bug or feature: `eval' vs `#!'
  2001-03-09 17:23     ` Christopher Faylor
@ 2001-03-09 19:13       ` Jerome BENOIT
  2001-03-12 10:34         ` Bob McGowan
  0 siblings, 1 reply; 6+ messages in thread
From: Jerome BENOIT @ 2001-03-09 19:13 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bug or feature: `eval' vs `#!'
  2001-03-09 19:13       ` Jerome BENOIT
@ 2001-03-12 10:34         ` Bob McGowan
  0 siblings, 0 replies; 6+ messages in thread
From: Bob McGowan @ 2001-03-12 10:34 UTC (permalink / raw)
  To: Jerome BENOIT; +Cc: cygwin

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-03-12 10:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-08 23:07 bug or feature: `eval' vs `#!' Jerome BENOIT
2001-03-09  8:38 ` Larry Hall (RFK Partners, Inc)
2001-03-09 15:22   ` Jerome BENOIT
2001-03-09 17:23     ` Christopher Faylor
2001-03-09 19:13       ` Jerome BENOIT
2001-03-12 10:34         ` Bob McGowan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).