Jump to content
roccitman

Getting results from terminal command

Recommended Posts

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

 

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

 

 

Edited by roccitman

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...