Run Unix shell script from Perl (Windows)

speedyguy

Cyborg Agent
My local machine is Windows 7, the unix shell script I need to run is kept in a unix server(I log in via putty to access it).

Now this is how I worked so far-

1> Created a perl script in windows local which has to code to login to putty with authentication and call the shell script. (used plink command)

2> Created the shell script and placed it in a location on the server.

3> Created a Java swing GUI to have a button call this perl script.

Now, things work fine. Java button calls the perl. Perl in turn logs into the backend unix server (putty), authenticates it and runs the shell script.

However, there are certain permissions and environment variables which are not valid when perl calls the unix shell script. It runs fine if I manually putty in to the unix and run using sh command. Is there any alternative to this?

Do let me know if I should elaborate on anything. Awaiting suggestions.

Enjoy~!
 
OP
speedyguy

speedyguy

Cyborg Agent
No error message. It's just that some unix shell environment variables are not identified when ran remotely via Java/Perl. I even tried to explicitly make the .bash_profile etc run before other scripts. Still did not help.

Enjoy~!
 
Top Bottom