Operating System - Linux
1752610 Members
3989 Online
108788 Solutions
New Discussion юеВ

Re: Running ksh script from javascript

 
SOLVED
Go to solution
Rick Meijer
Occasional Advisor

Running ksh script from javascript

Hello all.
How do I run an HP-UX shell script from within Javascript? Is it possible? I'm looking for something similar to PHP's exec.

Thanks in advance!
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: Running ksh script from javascript

Hi Rick:

I believe you have a system call available.

...

System.system("/usr/local/bin/mything")

Regards!

...JRF...
Torsten.
Acclaimed Contributor

Re: Running ksh script from javascript

Unlikely.

javascript runs on the client (browser), PHP runs on the server. For this reason there is the CGI (server side) from the beginning of web servers.

There are always examples in the
/apache/cgi-bin
directory.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Rick Meijer
Occasional Advisor

Re: Running ksh script from javascript

Thanks very much for the quick responses. I searched for "system.system" but came up with nothing but I am not done.

Yeah I was thinking that JavaScript being a client side scripting langauge would be a problem. I was looking in that direction because of its popularity. PHP is looking like a better way to go.

Thanks very much!
Torsten.
Acclaimed Contributor
Solution

Re: Running ksh script from javascript

It depends on what you want to do - PHP can do a lot. But via CGI you can write nice small scripts in your favourite script language - ksh, perl, tclsh, ... almost "on the fly"

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor

Re: Running ksh script from javascript

Hi (aain) Rick:

Notice the first "System" is an uppercase letter:

System.system("/usr/local/bin/mything")

Regards!

...JRF...

Rick Meijer
Occasional Advisor

Re: Running ksh script from javascript

After further review, I'm going the CGI route.

Thanks!