I am trying to send data from PHP to a bash script and then output the data back to the user. Why am I unable to send "beans" to the simple.sh and get it echoed back?
In the end, my goal is to get my web browser to output "beans". Very simple but I can't get it to work (complete noob).
Here is my test.php:
<?php
echo "<pre>";
$var = 'beans';
exec("/var/www/html/dev/simple.sh $var", $output);
echo var_dump($output);
echo "</pre>";
?>
Here is my simple.sh:
read var
echo $var
What am I doing wrong?