From: fpm@hotmail.com (Finnbarr P. Murphy)
Subject: Re: /dev/stdin .... ?
Date: 22 Dec 2003 20:23:28 -0800 [thread overview]
Message-ID: <afbc5c3a.0312222023.6b646b94@posting.google.com> (raw)
In-Reply-To: bs7npd$1aon$1@jeeves.eng.abbnm.com
In article <efbd1d5e.0312221147.57aecc0@posting.google.com>,
Barth Weishoff <barth.e.weishoff@cummins.com> wrote:
> Hello group,
>
> I've run this by HP, and they can't seem to come up with a clear
> answer. Anyway, long story short, I've been using here documents
> with OpenSSH's SFTP program to transfer files among hosts. Example
> (stolen from http://www.snailbook.com/faq/scripting-sftp.auto.html )
>
> #!/bin/sh
> echo "OK, starting now..."
> sftp -b /dev/stdin remotehost <<EOF
> cd pub
> ...
The following works on Tru64 UNIX 5.1B
sftp remotehost <<EOF
cd pub
....
EOF
Looking at the OpenSSH source code, the relevant code
snippet is in sftp.c:
....
infile = stdin; /* Read from STDIN unless changed by -b */
while ((ch = getopt(argc, argv, "1hvCo:s:S:b:B:F:P:R:")) != -1) {
switch (ch) {
....
case 'b':
if (infile == stdin) {
infile = fopen(optarg, "r");
if (infile == NULL)
fatal("%s (%s).", strerror(errno), optarg);
} else
fatal("Filename already specified.");
showprogress = 0;
break;
....
}
}
- Finnbarr
next prev parent reply other threads:[~2003-12-23 4:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-22 19:47 /dev/stdin .... ? Barth Weishoff
2003-12-22 21:30 ` Peter da Silva
2003-12-23 4:23 ` Finnbarr P. Murphy [this message]
2003-12-22 21:32 ` Spider Boardman
2003-12-23 2:47 ` Barth Weishoff
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox