Passing variables to shell script?

General discussions about LaunchBar
Post Reply
yanokwa

Passing variables to shell script?

Post by yanokwa » Mon Nov 27, 2006 7:31 am

Is there anyway to pass variables to a shell script in LB? In the same way that I can do stuff like "man grep", I want to be able to do "script.sh arg1 argv2"

norbert
Objective Development
Objective Development
Posts: 648
Joined: Thu Nov 09, 2006 6:30 pm

Post by norbert » Mon Nov 27, 2006 10:23 am

Just select the script in LaunchBar and press the space bar to enter arbitrary parameters.

yanokwa
Posts: 17
Joined: Mon Nov 27, 2006 9:03 pm

Post by yanokwa » Mon Nov 27, 2006 9:06 pm

Not working. It's doing a search when I hit the spacebar.

norbert
Objective Development
Objective Development
Posts: 648
Joined: Thu Nov 09, 2006 6:30 pm

Post by norbert » Thu Nov 30, 2006 3:50 pm

I see. The "script.sh" is probably not recognized as a "Unix Executable File" due to its .sh filename extension (you can verify this in Finder's Get Info window). As a workaround you might try to remove the .sh extension.

yanokwa
Posts: 17
Joined: Mon Nov 27, 2006 9:03 pm

Post by yanokwa » Sun Dec 10, 2006 10:36 am

That worked. Next question is if I can run this script as a background process so it doesn't show the terminal launching...

norbert
Objective Development
Objective Development
Posts: 648
Joined: Thu Nov 09, 2006 6:30 pm

Post by norbert » Mon Dec 11, 2006 6:41 pm

yanokwa wrote:Next question is if I can run this script as a background process so it doesn't show the terminal launching

Yes you can. Just confirm your input with Shift-Return instead of Return to run the script in background.

Post Reply