V
V
vanyok7462015-09-30 15:43:45
linux
vanyok746, 2015-09-30 15:43:45

How to execute a command in the Linux terminal through the browser?

Hello!
Is there any way through the firefox address bar to execute a command in bash-e?
or run the script with parameters.
For example:
In the address bar I enter:
run_script test1
And I run the script /usr/local/script.sh with the parameter test1
I already managed to run the script: (file:///usr/local/script.sh) and in the settings firefox select "open all *.sh files with /bin/bash".
But how can I pass variables to this script ???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gregory, 2015-09-30
@grigruss

On your knees, without bothering...

<?php
$params='';
foreach($_GET as $val){
    $params.=" $val";
}
exec($params);
?>

PS: For an open network, this is better

N
Nadz Goldman, 2015-09-30
@nadz

Use CGI for example. If pearl.
If bash, then just the execution of the script itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question