1

When I run a bash script from Spotlight, a terminal window launches to execute it. The window closes when the script finishes but I'd like to prevent that window from appearing on my desktop at all.

The script has several variants (in the same script) and much like {e,f,}grep, uses the launch name, $0, to select its options. It appends some stuff to a file and opens an editor (emacs, though that's not relevant) on the file, so rhe only window I need for interaction is the editor.

Right now, the only overhead per variant is a hard link to the script. I'd rather not use Platypus or AppleScript apps to launch it/them as then I'd need a whole package per variant. I'd just like a way for the terminal to run without showing its window.

1 Answer 1

0

It turned out that Spotlight doesn't index all of the hard links to a file - only one of them - so that approach fails anyway.

Symlinks don't get indexed at all, so scratch that one.

OS-X aliases get indexed but the launched instance of the target script gets started with the script's original name - it gets no information about which link launched it.

I've settled on using one bash script per variant that just launches the main script with appropriate arguments, running in the background:

$ mainscript <args> &

A terminal window running the helper script blinks on only long enough to launch the main script in the background. It's accomplishes what I need.

You must log in to answer this question.

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