HP3000-L Archives

May 2003, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Emerson <[log in to unmask]>
Reply To:
Tom Emerson <[log in to unmask]>
Date:
Fri, 30 May 2003 07:32:03 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
 [apologies in advance for any duplications -- seems this is the one-in-10
that don't make it from the e-mail client ;) Interestingly (or not) I don't
see this thread on the "newsgroup" side of the gateway, so there might be
even more missing from this discussion...]

On Thursday 29 May 2003 8:17 am, Peter Smithson wrote:

> I've got a lot of files on a PC with the extension ".xml".  I need to get
> them onto the HP3000 machine we have here.
>
> I can use ftp and type "put abc.xml ./abc.xml" and that works fine...
> But I can't do  "mput *.xml ./".
[gets "error -- missing group"]

have the PC build a list of files to transfer and pass the list as a set of
commands to FTP.  (MS)DOS has a "for" command that is very similar(**) to
the unix/posix "for" command.  In DOS, the command

FOR %f in *.xml DO ECHO put %f ./%f >>ftpcmds

should(*) create a file called "ftpcmds" that lists several "put" commands
with explicit names [note that if done "in batch", the % needs to be
duplicated, i.e., "for %%f in..."]  This in turn can be fed into the ftp
program like this:

   FTP USER@HP3000 <ftpcmds

[actually, you may need to prebuild/preface "ftpcmds" with ftp commands such
as "open", "user", and the user's password; as well as any remote-site CD
commands to get "pointed to" the proper location on the 3000 -- this is all
dependant upon the PC based FTP client that you use]

(*) I say "should" because I don't have access to a dos prompt to test this
at the moment [running from a linux workstation]  I've also found online
documentation for the "for" command to be spotty at best, for instance, one
site I found gave this as an example [begin cut/paste]

EXAMPLES

     for back do cd\

Would allow you in a batch file to do cd\ if 5 is specified else were in the
batch file.
[end paste]

given the rest of the text of this entry on that website, this example is
"just plain wrong".

(**) after-after thought: unix/posix "for" lets you specify a "list of
things", and that "list of things" might be the output of some other
program, or it could be an explicit string.  Also, the syntax for unix
includes some extra semicolons:

tom@bigbro:~> for word in Mary had "a little lamb";do echo --$word--;done
--Mary--
--had--
--a little lamb--
tom@bigbro:~>

note also the "controlling variable" (word) doesn't need the variable
indicator in the first part of the phrase, but does in the rest of the
command ($word).  And a final note is that an asterisk /on the command line/
causes "filename globbing", or expansion based on a match, so the command

   for filename in *.log;do echo put $filename ./$filename >>ftpcmds;done

produces the following "ftpcmds" file:
   put translog.20030525102627.log ./translog.20030525102627.log
   put translog.20030525105609.log ./translog.20030525105609.log

--
Yet another blog: http://osnut.homelinux.net

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2