roccitman Posted December 2, 2016 Share Posted December 2, 2016 Hey Gang Here's my sample workflow: click here. I am wanting to run a very short sql select and return the result to post to some output like a notification or large type. Is this possible with Alfred's terminal command? Link to comment
deanishe Posted December 2, 2016 Share Posted December 2, 2016 4 minutes ago, roccitman said: Is this possible with Alfred's terminal command? No. Terminal Command is for sending commands to your terminal application. Use a Run Script action with language set to /bin/bash instead. Link to comment
roccitman Posted December 2, 2016 Author Share Posted December 2, 2016 (edited) Ahh. OK. Is that going to be something like... tell application "Terminal" do script "ssh user@host.com" Edited December 2, 2016 by roccitman Link to comment
deanishe Posted December 2, 2016 Share Posted December 2, 2016 (edited) No. If you run it in Terminal.app, the output will be in Terminal.app. If you want the output in Alfred, you need to run the script in Alfred. Put the exact same script in a Run Script action and set language to /bin/bash (i.e. the Bourne Again SHell). If you need to enter a password, you'll have to add an additional action to ask for it first. Or better yet, set up key-based ssh access. Edited December 2, 2016 by deanishe Link to comment
deanishe Posted December 2, 2016 Share Posted December 2, 2016 Ah, wait. That won't work because you're relying on the fact that Alfred pastes the script into Terminal, so lines 2+ get sent to the server. You need to re-write your script as a proper ssh command. See here. Link to comment
roccitman Posted December 2, 2016 Author Share Posted December 2, 2016 OK, getting closer. Thanks for the help! Still learning variables. Do I use {query} or (system attribute "variablename") Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now