X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-Id: <59BFA592-AAB6-4120-9339-C10F472CA385@pobox.com>
From: Chap Harrison <clh@pobox.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v935.3)
Subject: Sending data to a script over SSH
Date: Wed, 1 Jul 2009 01:42:05 -0500
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

This question may well be non-specific to Cygwin, and perhaps more of  
an SSH or a Unix shell question.  If you can suggest a better forum  
I'd appreciate it!

The task is to fill out an Excel worksheet, copy a rectangular portion  
to the Windows clipboard, have a script read the clipboard, transform  
the data, and write the results back out to the Windows clipboard so  
that the user can then paste it into a text document.

 From Cygwin, I can get at the clipboard through /dev/clipboard - very  
handy indeed!  Only problem is that this requires that Cygwin be  
running in the same copy of Windows from which I'm doing the cutting  
and pasting.  This turns out to be a hard sell to management, who'd  
prefer that I keep Cygwin running in its own Windows environment.   
I've set up ssh and can now start a PuTTY session from my Excel world  
into my Cygwin world (which is fine - a lot my scripts *don't* require  
reading/writing the clipboard).

I'm wondering how to send a script invocation followed by the  
clipboard data that the script will read and transform.  I know how to  
use ssh to send a command to a remote system; I can do that from DOS.   
But is there any way to say "run this command and, by the way, the  
data it needs is right behind it"?  Sort of like an input redirection  
with a HERE-doc, to put it very loosely?

I hope that makes some sense.  And, obviously, the problem is not  
really about "clipboards" per se, but rather any input stream.

Thanks,
Chap Harrison

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

