开发者

run terminal commands from quicksilver

I know there is a Terminal plugin for quicksilver but I would invoke terminal commands which basically just runs in the background and never popups a terminal window. is that possible?

UPDATE:

I have the following code in my applescript but its gi开发者_如何学编程ving me an error:

do shell script "/path/to/shell.sh blah" 

error:

curses.setupterm()
_curses.error: setupterm: could not find terminfo database


In Quicksilver you can use the action "Run Command in Shell", which is part of the "Terminal Module". The command is run without showing a window. Search on the quoted terms and you'll find some examples.


Applescript is the simple solution, see: http://developer.apple.com/library/mac/#technotes/tn2002/tn2065.html

Sample:

do shell script "ifconfig"
do shell script "ifconfig" user name "Anne" password "p@ssw0rd" with administrator privileges

Automator can also run shell scripts in the background.

If you are familiar with XCode, you can use NSTask with Objective-C.


Hold on a sec, is your shell script a bash shell script? In your first line do you have:

#!/bin/bash

If not, add that line to your script. Also instead of just

do shell script "/path/to/yourscript.sh"

consider this:

do shell script "/bin/bash /path/to/yourscript.sh"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜