Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Instead of running a command in terminal, is it possible to run it 'in' the menubar in the background?

To keep the firewall open within the network I am in I use curl to ping a url every 5 minutes, using watch in Terminal, but this means I need to leave Terminal open all the time. Is it possible to 'send' this to the menu bar?

share|improve this question
What about a cronjob or a cronjob that executes your scripts within a shell script? – ricbax Oct 8 '10 at 16:41

Not easily. To create a menulet - I presume this is what you mean by running it in the menu bar - you would need to write some code of your own. Depending on your programming ability, and how much effort you want to put in, that may or may not be a solution.

Alternatively, you could minimise your terminal window to the dock. Depending on how visible you want the output to be, you could also run the command in the background with screen or otherwise. If you're looking for an obvious change, you could use a script that recognised this and used something like growlnotify to tell you about it.

share|improve this answer
Cheers. I was hoping there was a simple way to do it with Automator or something like that. I think screen would be the way to go. – Josh Hunt Oct 9 '10 at 23:42
Thanks for the upvote spree! – Daniel Beck Jul 4 '11 at 11:41

Not the answer to your question, but probably to your problem:

Use screen. This way you can quit Terminal and your processes keep running.

Ctrl-A Ctrl-C (create) creates new "screens" ("tabs"/"windows"), Ctrl-A Crtl-N (next) and Ctrl-A Ctrl-P (previous) cycle through them. Ctrl-A Ctrl-D (detach) exits screen.

screen -r to re-attach to a previous screen session and check the output.

share|improve this answer

I'm not sure why you need it in the menubar?

The following is a script that will loop, and hit some curl url on the loop. You need to run it in the terminal, but can close the terminal after that.


LOOPTIME=280 # just under 5 minutes

(while true;
do curl -I -s -o /dev/null $URL > /dev/null;
done) &

I included -I to just use HEAD, to save both yours and the server's bandwidth

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .