Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with rsh command

2 views
Skip to first unread message

Tanton Gibbs

unread,
Aug 19, 2002, 3:43:38 PM8/19/02
to Nikola Janceski, Beginners (E-mail)
One thing you might check is your PERL5LIB environment variable when you rsh
vs when you login. It could be that rsh does not run your .profile and
therefore does not set up your environment variables thereby prohibiting
perl from seeing the appropriate libraries.
----- Original Message -----
From: "Nikola Janceski" <nikola_...@summithq.com>
To: "Beginners (E-mail)" <begi...@perl.org>
Sent: Monday, August 19, 2002 3:42 PM
Subject: Problems with rsh command


> I have posted this to XML and no response there. so maybe it's simpler
than
> that...
>
> I have script that uses XML::Simple, which works when run via command
line:
> /yyy/TreeInfo/tmp/gather_os_info.pl
>
> but if run it via an rsh command (on the same host for now):
> /bin/rsh host1 /yyy/TreeInfo/tmp/gather_os_info.pl
>
> I get the following error:
> Can't locate object method "new" via package "XML::SAX::PurePerl" (perhaps
> you forgot to load "XML::SAX::PurePerl"?) at
> /yyy/perl-5.6.1-unix/lib/perl5/site_perl/5.6.1/XML/SAX/ParserFactory.pm
line
> 37.
>
> ** NOTE **: Specifically it fails on the XMLin() function call supplied by
> XML::Simple.
>
> Strange huh? host1 is the same host where I tested it via command line
> alone.
>
> Please I can't figure this one out for the life of me.
>
> Thanx in advance,
>
> Nikola Janceski
>
> When I am working on a problem I never think about beauty. I only think
> about how to solve the problem. But when I have finished, if the solution
is
> not beautiful, I know it is wrong.
> -- Buckminster Fuller (1895-1983)
>
>
> --------------------------------------------------------------------------
--
> --------------------
> The views and opinions expressed in this email message are the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
>
>
> --
> To unsubscribe, e-mail: beginners-...@perl.org
> For additional commands, e-mail: beginne...@perl.org
>
>
>

Nikola Janceski

unread,
Aug 19, 2002, 3:42:02 PM8/19/02
to Beginners (E-mail)

Nikola Janceski

unread,
Aug 19, 2002, 3:50:27 PM8/19/02
to Tanton Gibbs, Beginners (E-mail)
nope.. then it would be able to get that far.

Remember I have:
use XML::Simple;

Which calls other modules (XML::SAX etc.)
but stranger is that PurePerl.pm is in the same dir as the ParserFactory.pm.

plus the onlything I have in my PERL5LIB env var is my private module dirs.
I use 'use lib' all the time anyway.

> -----Original Message-----
> From: Tanton Gibbs [mailto:thg...@deltafarms.com]
> Sent: Monday, August 19, 2002 3:44 PM
> To: Nikola Janceski; Beginners (E-mail)
> Subject: Re: Problems with rsh command
>
>
> One thing you might check is your PERL5LIB environment
> variable when you rsh
> vs when you login. It could be that rsh does not run your
> .profile and
> therefore does not set up your environment variables thereby
> prohibiting
> perl from seeing the appropriate libraries.

Nikola Janceski

unread,
Aug 19, 2002, 5:40:42 PM8/19/02
to Nikola Janceski, Tanton Gibbs, Beginners (E-mail)
host1 is one host. the only host that I have been testing this on.
via command line it works.
via rsh command line it doesn't.
via rsh to command prompt, then command lining it, it works.

It looks like it is differences in the env. vars.
essentially when I use rsh and run a command (ie rsh host1 env) the env is
pretty damn empty.
but when I just rsh to the host the env comes back full (ie rsh host [wait
for prompt] env).

now to think of a way to fix this... better to know what env to set so I can
set it in the script.

Thanx for your help!

> --
> To unsubscribe, e-mail: beginners-...@perl.org
> For additional commands, e-mail: beginne...@perl.org
>

----------------------------------------------------------------------------

Drieux

unread,
Aug 19, 2002, 5:48:10 PM8/19/02
to begin begin

On Monday, August 19, 2002, at 12:42 , Nikola Janceski wrote:
[..]

> but if run it via an rsh command (on the same host for now):
> /bin/rsh host1 /yyy/TreeInfo/tmp/gather_os_info.pl
>
> I get the following error:
> Can't locate object method "new" via package "XML::SAX::PurePerl" (perhaps
> you forgot to load "XML::SAX::PurePerl"?) at
> /yyy/perl-5.6.1-unix/lib/perl5/site_perl/5.6.1/XML/SAX/ParserFactory.pm
> line
> 37.
[..]

you have ruled out the usual 'more than one perl' problem with

/bin/rsh host1 "perl -V"

and that it is the perl that you expect???? Since it
is possible - IF you have more than one version of
perl running on the host, AND the ordering of the
PATH is different - then you may be invoking a version
who's notion of what the @INC should be is NOT the
one that you expect....

also tell me you are not running into the less
well known problem of the '-n' problem with rsh.

sometimes what you neeed to do is

/bin/rsh -n host1 cmd

so that it does not try to read STDIN from
your current shell into it....

I can't imagine why that might be an issue,
but at times that has been the 'irrational fix'

HTH.

ciao
drieux

---

Drieux

unread,
Aug 19, 2002, 6:01:41 PM8/19/02
to Nikola Janceski, Tanton Gibbs, Beginners (E-mail)

On Monday, August 19, 2002, at 02:40 , Nikola Janceski wrote:

> host1 is one host. the only host that I have been testing this on.
> via command line it works.
> via rsh command line it doesn't.
> via rsh to command prompt, then command lining it, it works.

if you do an

rsh farhost

you force a 'login event sequence'.

as such

rsh farhost
telnet farhost
rlogin farhost

are essentially the same....


what you may want to think about is making sure
that your perl script 'imports' all the env foo....

or you will need a shell wrapper script to make sure
that you have that environment sorted out PRIOR to
actually invoking the perl code itself....

the ugly here of course is that if you have installed
objects such as the libfoo.so in non-standard places
and/or need to access environmental variables........

0 new messages