tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Garry Optland <garry () pp ! nsw ! gov ! au>
To: tru64-unix-managers
Subject: Summary [Rev2]: Sending mail to a perl script.
Date: Fri, 03 May 1996 02:19:12 +0000	[thread overview]
Message-ID: <96076332421164.tru64-unix-managers.marc@archive.invalid> (raw)

Hi All,

In my summary yesterday I said: 

> The answer is to change the alias from:
> 
> test:   "| /usr/local/mail/bin/test.pl"
> to:
> test:   "| /usr/bin/perl /usr/local/mail/bin/test.pl"

However, futher help from others and testing revealed that this was not 
the story. 

The real answer was that as root, I do not have /usr/local/bin in my path.
I had set up a link linking /usr/bin/perl to /usr/local/bin/perl. The
permission that I checked on /usr/bin/perl was:  lrwxrwxrwx. However,
/usr/local/bin/perl was -rwx-rx-r--. 

My confusion (and reason for asking for help) was I could "cat mailfile | 
/usr/local/mail/bin/test.pl" and it worked, but when I mailed to the alias 
it bombed out. I thought that the prog mailer had trouble because it used 
sh to call a perl script, but the real reason was that sh could not 
execute perl. I am not sure if this is a bug or a feature, where the 
permissions on the link get overridden by the real file :-)

So in summary, in the alias file, you only need:
test:    "| /usr/local/mail/bin/test.pl" 
as long as the first line of the perl script is #!/usr/bin/perl (or 
whatever your path to perl is), although the other version works as well.

Sorry to cause confusion and take up extra bandwidth. In testing 
suggestions and making changes, I rushed the summary out too quickly.

Thanks to all that helped.

Regards,
	 Garry.

--------------------------------------------------------------------
Garry Optland - Unix Specialist       Email: garry@pp.nsw.gov.au
Pacific Power                         phone: +61 2 268 6160
Park & Elizabeth Streets  Sydney  NSW  2001  Australia
--------------------------------------------------------------------

                 reply	other threads:[~1996-05-03  2:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox