troubleshooting Question

can't get rexec to execute from server $PATH

Avatar of Kwal
Kwal asked on
Scripting Languages
3 Comments1 Solution450 ViewsLast Modified:
I use rexec and command strings to execute form data into a remote database.

My perl script executes the rexec to the remote server database using this example

$command="rexec \"/appl/remote/bin/dbexch ID:userid"

My problem is sometimes it works and sometimes it does not. Like today it does not work and when I checked  my server error.log file I see sh: rexec not found.

If I execute the rexec and the full command line from a telnet session it works. Before I can execute anything from a telnet I have to do a export PATH=$PATH:/whatever/directory/name/iamat

If I do not do an export PATH=$PATH at telnet session, then I'll get a ksh: rexec not found -- the same as what the error.log records.

It seems like rexec is in my $PATH but not in the webserver $PATH. So I tried inserted the following above the perl script before it executes rexec

$ENV{PATH} .= ":/path/to/dir/containing/rexec";

I still could not get rexec to execute from the webserver using the above.

Would anyone know what is the right method to execute $PATH from webserver within a perl script?

thank you.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros