Jump to content

Getting results from terminal command


Recommended Posts

Posted
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.

Posted (edited)

Ahh. OK. Is that going to be something like...

 

tell application "Terminal"
    do script "ssh user@host.com"

 

 

Edited by roccitman
Posted (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 by deanishe
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...