If I create a script that will restart apache:
service httpd restart
... I will never know what the output was because it does not open the terminal window.
I am wondering if the output can be taken and then forwarded to:
notify-send output
... this way there is some visual of what happened for few seconds on the screen.
First, you really should look inside the terminal when running your script.
Also, notice that services are started before login time (at boot time).
And server daemons like Apache or Lighttpd have their own log files usually under
/var/log/
;You could put the output of
service httpd restart
command into some variable likewhere
2>&1
redirects stderr to stdoutthen you can show that with
But I don't think all this is a good idea. You should take the habit of restarting services inside a terminal and have a look at the output (in the rare case something gets wrong, you'll need all of it).
Read the Advanced Bash Scripting Guide.