views:

8

answers:

0

Is there a way, from ssh, to get output back to the shell ssh was invoked from, kind of like :! in vim?

For example, say I'm grepping a file for 'bananas' on a remote server, and I want to copy the output to an IM window - is there a way to invoke pbcopy on my local machine, or am I stuck selecting/copying from the terminal window?

In particular, I'm interested in a solution that would work with an interactive shell. Obviously I can do this if I pass the command as an argument, i.e.

ssh myserver grep bananas /var/log/fruit.log | pbcopy