delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/28/23:52:50

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-Id: <5.2.1.1.2.20030428224615.01930008@coolbrew.com>
X-Sender: gmccrory AT coolbrew DOT com (Unverified)
Date: Mon, 28 Apr 2003 22:52:30 -0500
To: cygwin AT cygwin DOT com
From: Greg McCrory <greg AT coolbrew DOT com>
Subject: Re: Calling perl script from shell script: Win32 error 126
In-Reply-To: <Pine.GSO.4.44.0304282331230.18475-100000@slinky.cs.nyu.edu
>
References: <5 DOT 2 DOT 1 DOT 1 DOT 2 DOT 20030428215943 DOT 01b9a818 AT coolbrew DOT com>
Mime-Version: 1.0

At 4/28/2003 11:35 PM -0400, Igor Pechtchanski wrote:

>Greg,
>
>No, it's not necessary to set the PATH, I was just trying to guess why
>there was a difference between a shell script and the command line...
>Just out of curiousity, is the PATH the same in the shell script and in
>the shell?
>
>Also, are you executing Cygwin perl in both cases?  Try "type -a perl"
>from the shell (bash?)...  How are you invoking the script (i.e., by
>calling it directly, or through "perl scriptname")?  If directly, what
>does the shebang ("#!") line at the top of the script say?
>     Igor


I need to add new information to this issue.  I mistakenly thought I was 
getting this error from within a general shell script.  I now see the error 
actually occurs only when the script is run as a service.

Example:
#!/bin/sh
export PERL_DL_DEBUG=1

while sleep 5
do
if [ -f "/tmp/flag" ];
then
    rm /tmp/flag
    perl -e 'use Image::Magick; print("Hello!");'
fi
done

## end script

When run from command line, works fine.  when installed as service yields:
<<<
Can't load 
'/usr/lib/perl5/site_perl/5.6.1/cygwin-multi/auto/Image/Magick/Magick
.dll' for module Image::Magick: dlopen: Win32 error 126 at 
/usr/lib/perl5/5.6.1/
cygwin-multi/DynaLoader.pm line 206.
 >>>




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