delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/01/31/16:46:52

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: Wed, 31 Jan 2001 23:41:57 +0200
Message-Id: <200101312141.XAA24689@linux.>
From: "Ehud Karni" <ehud AT unix DOT simonwiesel DOT co DOT il>
To: "Josifovski Ljubomir-BLJ01Z" <BLJ01Z AT motorola DOT com>,
" Mumit Khan" <khan AT NanoTech DOT Wisc DOT EDU>
Subject: Re: [OT] #!/usr/bin/env bash -vx
CC: cygwin AT sourceware DOT cygnus DOT com
Organization: Simon & Wiesel Insurance agency
Reply-to: ehud AT unix DOT simonwiesel DOT co DOT il
References: <D1F0002F0A8FD411ACEC00805FE675CE260F22 AT zuk02exm02 DOT comm DOT mot DOT com>
X-Mailer: Emacs 20.7.1 rmail (send-msg 1.104)
MIME-Version: 1.0

On Wed, 31 Jan 2001 16:18:28 -0000, Josifovski Ljubomir-BLJ01Z
    <BLJ01Z AT motorola DOT com> wrote:
> 
> This is not exclusive to cygwin, but maybe someone here can help me. I put
> 
> #!/usr/bin/env bash -vx
> this doesn't work - I get:
> 
> $ qwe
> /usr/bin/env: bash -vx: No such file or directory

Date: Wed, 31 Jan 2001 11:17:56 -0600 (CST), Mumit Khan
    <khan AT NanoTech DOT Wisc DOT EDU> wrote:
>
> It's the way env works, especially in conjunction with '#!'. 

Well, It is not env fault. The problem is the activation of a file
with the magic `#!'. The invocation is different among UNIXes, but it
won't do what you want on any of them. On Linux and Cygwin (and may be
other GNU systems) this magic produce the following effect:
argv[0] = string after the #! with whitespaces striped.
argv[1] = rest of the line AS IS (whitespaces striped from both sides)
srgv[2] = name of the invoked file (relative or absolute depending on
          how the file is called by the executing command).
On DG/UX and Solaris (as reported by Bob McGowan <rmcgowan AT veritas DOT com>)
argv[1] is the 2nd string (between spaces, AS IS), the test of the line
is ignored.

You can easily check it by changing the 1st line to  #! /bin/echo ....

Ehud.


-- 
 @@@@@@ @@@ @@@@@@ @    @   Ehud Karni  Simon & Wiesel  Insurance agency
     @    @      @  @@  @   Tel: +972-3-6212-757    Fax: +972-3-6292-544
     @    @ @    @ @  @@    (USA)  Fax  and  voice  mail:  1-815-5509341
     @    @ @    @ @    @        Better     Safe     Than     Sorry
 http://www.simonwiesel.co.il    mailto:ehud AT unix DOT simonwiesel DOT co DOT il

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