From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16301 invoked by alias); 27 Jun 2002 15:18:50 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 16252 invoked from network); 27 Jun 2002 15:18:48 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by sources.redhat.com with SMTP; 27 Jun 2002 15:18:48 -0000 Received: from list by main.gmane.org with local (Exim 3.33 #1 (Debian)) id 17Nb2O-0003I7-00 for ; Thu, 27 Jun 2002 17:18:24 +0200 To: cygwin@cygwin.com X-Injected-Via-Gmane: http://gmane.org/ Received: from news by main.gmane.org with local (Exim 3.33 #1 (Debian)) id 17Nb2N-0003Hs-00 for ; Thu, 27 Jun 2002 17:18:23 +0200 Path: not-for-mail From: Joe Buehler Newsgroups: gmane.os.cygwin Subject: Re: RE : bash question, perhaps problem Date: Thu, 27 Jun 2002 09:22:00 -0000 Message-ID: <3D1B2CD4.4060207@hekimian.com> References: <5.1.0.14.2.20020626062010.01b43240@pop3.cris.com> <000001c21d5e$661d9020$022b01c0@patin> NNTP-Posting-Host: hekimian.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1025191103 12630 206.205.138.10 (27 Jun 2002 15:18:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 27 Jun 2002 15:18:23 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en X-SW-Source: 2002-06/txt/msg01540.txt.bz2 bruno patin wrote: > The problem we have is that we use a root value obtained by pwd and > append to it what is given to us by the $0 variable. I may misremember, but I think that at least one older UNIX version did not use to provide the name of the script in $0. I believe it was a version of System V that would actually give you something like /dev/fd/7 for $0. A Google search for "argv /dev/fd" in fact yielded the following from what appears to be an IRIX man page for the exec() system call: Set-user-ID, set-group-ID interpreter files and those with attached capabilities are handled in a special manner. If execution of an interpreter file will change either the user or group ID or the file has attached capabilities, IRIX will open the interpreter file for reading (subject to the read permissions of the interpreter file and the user and group ID of the new process). A pathname corresponding to the interpreter file descriptor will be substituted for the pathname of the interpreter file in the argument list passed to the intepreter. This pathname will be of the form /dev/fd/N where N is the number of the interpreter file descriptor. It may work on the systems you usually use, but it's not portable. Joe Buehler -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/