🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.misc
Article #2041

How to launch a shell script (.sh) from an HTML page ?

#2041
From: David Winter
Date: Tue, 23 Oct 2001 09:30
41 lines
2632 bytes
Hi,

I'm sure somebody already posted the solution some time ago, but I couldn't
find it.
I need to launch a sheel script (.sh file) from an HTML page under unix
(Solaris and others).
I am NOT using any server: this only a LOCAL html page. No virtual
directories.

Right now I am using the following code, that is executed from an image
button in an HTML <form>:

<script>
function openMyFile ()
{
    if (document.layers)
    {
        var exePath = new String('. ./test.sh');

netscape.security.PrivilegeManager.enablePrivilege('UniversalExecAccess');
        java.lang.Runtime.getRuntime().exec(exePath);
    }
}
</script>


The test.sh file changes the current directory in order to run another sh
that launches a java application.

I have tried several shell commands, such as:

    '. ./test.sh'
    './test.sh'

but no luck. Nothing happens and my sh file is not launched.
Any ideas ? Please reply in this newsgroup.


Thank you for your help,

David Winter
Technical Details
Message-ID: <9r3fue$6k5$1@news.businessobjects.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!inetway!213.11.117.2.MISMATCH!businessobjects.com!businessobjects-int!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,ce5dc68f68e2e00a,start
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: fe1d2,ce5dc68f68e2e00a,start
X-Google-Attributes: gidfe1d2,public
X-Google-Thread: f72b0,ce5dc68f68e2e00a,start
X-Google-Attributes: gidf72b0,public
X-Google-Thread: 11035d,ce5dc68f68e2e00a,start
X-Google-Attributes: gid11035d,public
X-Google-Thread: 110f2c,ce5dc68f68e2e00a,start
X-Google-Attributes: gid110f2c,public
X-Google-Thread: fa664,ce5dc68f68e2e00a,start
X-Google-Attributes: gidfa664,public
X-Google-Thread: 1012a6,ce5dc68f68e2e00a,start
X-Google-Attributes: gid1012a6,public
X-Google-ArrivalTime: 2001-10-23 02:31:28 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!inetway!213.11.117.2.MISMATCH!businessobjects.com!businessobjects-int!not-for-mail
From: "David Winter" <noemail@nospam.com>
Newsgroups: comp.unix.misc,comp.unix.questions,comp.unix.sco.misc,comp.unix.sco.programmer,comp.unix.shell,comp.unix.solaris,fr.comp.os.unix
Subject: How to launch a shell script (.sh) from an HTML page ?
Date: Tue, 23 Oct 2001 11:30:10 +0200
Organization: Business Objects
Lines: 43
Message-ID: <9r3fue$6k5$1@news.businessobjects.com>
NNTP-Posting-Host: nanterre.product.businessobjects.com
X-Trace: news.businessobjects.com 1003832078 6789 10.6.144.37 (23 Oct 2001 10:14:38 GMT)
X-Complaints-To: abuse@businessobjects.com
NNTP-Posting-Date: 23 Oct 2001 10:14:38 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300