*.command files

mattimpact

Registered
Anyone know how to set up .command files? All I know is that they are double-clickable and they open up a terminal window with a command already running in it. I would like to set up an icon on my desktop that would allow me to open terminal and run TOP all in one click.

Any help would be appreciated. Thanks in advance!

-Matt:confused:
 
Here's a sample session of how you could create such a file:
Code:
% [b]cat > Run_Top.command[/b]<return>
[b]#!/bin/sh[/b]<return>
[b]top -u -s 2[/b]<return>
<ctrl-D>
% [b]chmod +x Run_Top.command[/b]<return>
That should do it. Note that you cannot have spaces in the file name. Also you could probably make the file a one-liner with #!/bin/top -u -s 2 or something.

-Rob
 
Back
Top