Anda di halaman 1dari 3

Running Unix Executables

http://www.obdev.at/resources/launchbar/help/RunningUnixExecutable...

1 of 3

4/9/2014 11:22 AM

Running Unix Executables

http://www.obdev.at/resources/launchbar/help/RunningUnixExecutable...

Running Unix Executables


When youve selected a Unix Executable or a Shell Script in LaunchBar, press Return to execute it in a new Terminal window. The factory configuration contains an indexing rule named Unix Executables. This rule is disabled by default - turn it on to get access to a number of commonly used command line tools such as man, ssh, traceroute, etc.
Note: If you prefer to use iTerm in favor of Terminal, you can specify your Preferred Terminal application in the Actions pane of LaunchBar preferences.

Running in background
By default, LaunchBar runs Unix Executables and Shell Scripts in a newly opened Terminal window. You can optionally run them in background (without any window) by opening them with Option-Return.

Passing string parameters


To pass string parameters to Unix Executables and Shell Scripts, do one of the following: Select the script or executable item and press the space bar. A text field will appear where you can enter the parameters that shall be passed to the command. Select a text item, then press Tab and select the desired script or executable.

Examples
INPUT RESULT

MAN [Space] bash TRR [Space] hostname SSH [Space] hostname CAL [Space] 1984

opens the bash man page runs the traceroute command for the given host establishes an SSH connection to the given host shows a calendar of 1984

Passing files and URLs as arguments


You can pass file paths or URLs to Unix Executables and Shell Scripts either via drag and drop or via LaunchBars Send to functionality. The passed file paths or URLs will then be appended to the command-line. Drag and drop: Select the desired command in LaunchBar and drag items e.g. from Finder onto that command. Choose Send to from the pop-up menu or hold down the Command key during the drag to pass the dragged items immediately. Send to: Select a file or URL in LaunchBar, then press the Tab key to trigger the Send to action. Now select the desired target command and press Return.

Preparing Shell Scripts


LaunchBar must be able to distinguish a Shell Script from an ordinary plain text file. First, make sure that

2 of 3

4/9/2014 11:22 AM

Running Unix Executables


your script contains a proper shebang line:
#!/usr/bin/ruby puts 'Hello world'

http://www.obdev.at/resources/launchbar/help/RunningUnixExecutable...

Further, the script must have execute permissions set to make LaunchBar recognize it as a Unix Executable:
chmod +x MyHelloWorldScript

3 of 3

4/9/2014 11:22 AM

Anda mungkin juga menyukai