WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: perl script on mc9  (Read 952 times)

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
perl script on mc9
« on: October 24, 2018, 09:16:19 PM »
Hi all,

I'm having a bit of trouble with sendEmail.tcz

I"ve just installed it, and perl5 dependency ok.

I have sendEmail + sendEmail.pl in /usr/local/bin dir
Which are lnks to /tmp/tcloop/sendEmail/usr/local/bin

Anyway..
When I run sendEmail or sendEmail.pl or ./sendEmail.pl I get following error.

Quote
-sh: .sendEmail: not found

I don't remember having this much trouble in the past with this script :)

All coments and suggestions welcome.

Live long and prosper.

Offline NewUser

  • Jr. Member
  • **
  • Posts: 70
Re: perl script on mc9
« Reply #1 on: October 24, 2018, 09:29:53 PM »
From the directory sendEmail.pl is in, what does perl -v return?

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: perl script on mc9
« Reply #2 on: October 24, 2018, 10:01:43 PM »
/usr/local/bin$ perl -v

Code: [Select]
This is perl 5, version 26, subversion 1 (v5.26.1) built for i486-linux-thread-multi

Copyright 1987-2017, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Live long and prosper.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6349
Re: perl script on mc9
« Reply #3 on: October 25, 2018, 05:19:11 AM »
Hi remus
Maybe the install script that was removed from  perl5  is causing a problem? It looked like this:
Code: [Select]
tc@box:~$ cat /usr/local/tce.installed/perl5
#!/bin/sh

ln -s /usr/local/bin/perl /usr/bin
tc@box:~$

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: perl script on mc9
« Reply #4 on: October 25, 2018, 04:37:36 PM »
Hi remus
Maybe the install script that was removed from  perl5  is causing a problem? It looked like this:
Code: [Select]
tc@box:~$ cat /usr/local/tce.installed/perl5
#!/bin/sh

ln -s /usr/local/bin/perl /usr/bin
tc@box:~$

Thanks for the input Rich.

My /usr/local/tce.installed/perl5 file is blank
Code: [Select]
tc@mc9vm:~$ cat /usr/local/tce.installed/perl5
tc@mc9vm:~$

I've added
Code: [Select]
ln -s /usr/local/bin/perl /usr/bin to my bootlocal.sh file as a long term fix

sendEmail is working now.

Perhaps the perl5 package needs an update ? Or is this particular pathing requirment unique to sendEmail ?

Thanks again for your help Rich :)

Live long and prosper.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6349
Re: perl script on mc9
« Reply #5 on: October 25, 2018, 04:58:43 PM »
Hi remus
... Perhaps the perl5 package needs an update ? Or is this particular pathing requirment unique to sendEmail ? ...
TC4 had the startup script and TC9 lost it. If you look at the change log in the TC9 version:
Quote
Change-log:     2009/01/11 first version
                2009/05/18 re-compiled for tc_2.x, edited Makefile and config.sh for tc cflags/cppflags
                2009/10/02 updated 5.10.0 -> 5.10.1, re-compiled with static libperl without threads
                2011/09/30 updated 5.10.1 -> 5.14.1
                2013/03/23 updated 5.14.1 -> 5.16.3
                2014/07/02 addded symlink /usr/bin/perl
                2014/09/18 updated 5.16.3 -> 5.20.0
                2014/11/27 added /usr/bin/perl symlink
                2015/10/02 updated 5.20.0 -> 5.22.0
                2016/10/20 updated 5.22.0 -> 5.24.0
Current:        2017/12/09 updated 5.24.0 -> 5.26.1
you'll note it was added back in a couple of times.

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: perl script on mc9
« Reply #6 on: October 25, 2018, 05:07:38 PM »
Are you saying this is a patch normally done at the OS level ?

Live long and prosper.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6349
Re: perl script on mc9
« Reply #7 on: October 25, 2018, 05:16:30 PM »
Hi remus
... Or is this particular pathing requirment unique to sendEmail ? ...
My guess is that  sendEmail  has  /usr/bin/perl  hardcoded somewhere in it.

Are you saying this is a patch normally done at the OS level ?
Not necessarily. I will say that either
A. Extensions should not hardcode paths to system executables (preferable).
or
B. The perl extension should create the symlink to accommodate those hardcoded paths.

Offline remus

  • Sr. Member
  • ****
  • Posts: 369
Re: perl script on mc9
« Reply #8 on: October 25, 2018, 06:42:26 PM »
Thanks for clarifying that.
Seems like sendMail needs an alternation.
Live long and prosper.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 6349
Re: perl script on mc9
« Reply #9 on: October 25, 2018, 07:16:47 PM »
Hi remus
... Seems like sendMail needs an alternation. ...
Then you're in luck. The info file lists you as the maintainer. ;D

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9936
Re: perl script on mc9
« Reply #10 on: October 26, 2018, 12:02:46 AM »
Yeah the recommended shebang is "#!/usr/bin/env perl" which doesn't care where perl is.
The only barriers that can stop you are the ones you create yourself.