delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/09/12/11:25:00

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: RE: Re: Webdav batch file transfer: curl, wget
Date: Wed, 12 Sep 2007 11:24:26 -0400
Message-ID: <31DDB7BE4BF41D4888D41709C476B657068AB56A@NIHCESMLBX5.nih.gov>
In-Reply-To: <fc8trb$rav$1@sea.gmane.org>
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder AT niaid DOT nih DOT gov>
To: "Richard Ivarson" <RiIvarson AT gmail DOT com>, <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l8CFOnNk020379

Richard Ivarson wrote on Wednesday, September 12, 2007 10:42 AM:
> Steve Holden schrieb:
> [..]
>>>>  curl --user NAME:PASSWORD
>>>> https://webdavserver.com/folder/{fileAA,fileBB,fileCC,fileDD,fileEE,
>>>> }.txt -O -O -O -O -O
>>> 
>>> ... I forgot to mention: In contrast to A)1) with curl you can omit
>>> the ":PASSWORD" in the script. The curl then nicely asks for it at
>>> runtime. 
>>> 
>> I don't know about getting rid of the five -O's (have you tried it
>> with just one to see whether that does what you want?),
> 
> Yes, I tried: with one "-O" just the first "fileAA.txt" will be
> written to local file ("fileAA.txt"), while the other files will be
> printed to the standard output (console).  
> 
>  > but you could shorten
>> the command line a bit using
>> 
>> https://webdavserver.com/folder/file{AA,BB,CC,DD,EE}.txt
> 
> Nice.

Curl will also do it by itself.  (You may have to quote the URL so that the shell does not expand the it.)  The following is from the man page.  Note the {curly braces}.

URL
	The URL syntax is protocol dependent. You'll find a detailed
	description in RFC 3986.

	You  can  specify  multiple  URLs or parts of URLs by writing
	part sets within braces as in:

	  http://site.{one,two,three}.com

	or you can get sequences of alphanumeric series by using [] as in:

	  ftp://ftp.numericals.com/file[1-100].txt
	  ftp://ftp.numericals.com/file[001-100].txt  (with leading zeros)
	  ftp://ftp.letters.com/file[a-z].txt

	No nesting of the sequences is supported at the moment, but you
	can use several ones next to each other:

	  http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019