delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/27/14:53:50

X-Spam-Check-By: sourceware.org
Message-Id: <1141070017.14148.255392778@webmail.messagingengine.com>
From: "Brett Serkez" <techie AT serkez DOT net>
To: "Jukka Laurila" <jplauril AT cc DOT hut DOT fi>, cygwin AT cygwin DOT com
MIME-Version: 1.0
Subject: Re: Can't execute shell script as wish subprocess, exes work
Date: Mon, 27 Feb 2006 14:53:37 -0500
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

>>    It appears your PATH doesn't include the directory for my-shell-
>>    script.
> As I said, my PATH _does_ include that directory
> (/cygdrive/c/users/bin).
<snip>

Yes, you did, but you are also not taking into account process
inheritance. When you pipe a command, subprocesses are being created and
I suspected the path isn't being properly inherited.  When you use the
the shell to execute your command, you are re-establishing the path.

So I'll ammend my original statement to say that it appears your PATH
doesn't include the directory for my-shell-script in the process that
is trying to exec your script and/or exec isn't using the path you
think it is.

It has been some time since I dealt with this, but only global variables
are inherited, which some shells require you to use export or setenv to
designate, and some shells require PATH to be exported and others don't.

Brett
----------------------------------------------------------------
Brett C. Serkez, Techie


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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