I have a simple grep task I want to make executable in my web browser. Here is the script:
# Get input from user to grep in /home/user/test-file.txt
echo -n "Please enter grep input: "
grep $grepInput /home/user/test-file.txt
Instead of having going to the command line to run ./grep-script.sh, I want to have an input box and a button on the web page. The info in the input box becomes the read variable when you click the button. Then it executes the script on the command line and brings back the results on the web page.
The web page is from the same box I wish to execute the grep command -- /var/www/html/index.html. And I have apache installed.
I know the task itself is basically worthless. But the main point is to learn a simple task like this in order to open doors to larger projects.
Any ideas on how to do this? Thanks.