1

If I have a simple bash script

#!/bin/bash
touch ./test.txt

that I want to be activated on the push of a button on any simple html page how would I go about this?

html looking something like this (tho i know it's wrong)

<form action="./test.sh">
        <input type="submit" value="Open Script">
 </form>

Thanks for any help!

3
  • Related: stackoverflow.com/questions/6235785/…
    – Liso
    May 16, 2019 at 3:09
  • I'm getting a "Cannot GET /test.php" when i push the button
    – David
    May 16, 2019 at 3:42
  • From the context of the page running on a server as is normal with most websites, or a page running locally just on your own machine? On a server, use a server-side language to execute the script, e.g. PHP in Apache, a JSP(Java) in an app server. Locally, the browser security model should prevent you from actually executing anything on the local machine.
    – Steve
    May 16, 2019 at 7:06

0

You must log in to answer this question.

Browse other questions tagged .