[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] How do I use relative files on the cmd line with a base?

From: Ángel González
Subject: Re: [Bug-wget] How do I use relative files on the cmd line with a base?
Date: Fri, 15 Jun 2012 20:19:22 +0200
User-agent: Thunderbird

On 15/06/12 19:50, Linda Walsh wrote:
> 0000
> well -- the http address is 80 characters long --
> some of the base's pathname chars had  shell unfriendly
> chars in them -- to the point that I *had* to put the base URL into
> a file and not on the command line (kept running into quoting
> problems)...
> The filenames were relatively simple (foo.rpm... x.rpm...etc...)..
> Try your example with
> base="http://download.openproject.org/repositories/devel:/languages:/perl/openproject_Factory/src/?release=alpha1.0&lang=en&encoding=binary&source=";
> and files = package?arch=x86_64&fmt=rpm,name=package1
> package?arch=no_arch&fmt=rpm,name=package2, ...
> Expand that in a shell... and it doesn't work so well...
Are you sure? :)


> Not to mention, doing 10 lines at a time make the lines expand to
> over 1360 chars (because the base is 136 chars by itself
> exclusive of wget options and the file names...

> Many times, I've had a long URL name that I want to set, then just
> enter filenames relative to that base.
> and with the base being complicated -- I just want to put it in a
> file...)
> I don't see why putting filenames on the command line ignores the -B
> switch??
> I.e. -- what is the purpose served by ignoring a "B" switch the user
> specifies on the command
> line when they fetch files?  Is there a benefit to it being ignored?
How is it failing?

(echo "package?arch=x86_64&fmt=rpm,name=package1"; echo
"package?arch=no_arch&fmt=rpm,name=package2" )> file
wget -B
-i file

Tries to download:

Adding another url to the end, just downloads one more url.

> So I wanted to put the base in a file and just use -B "$(<base)", and
> put the filenames at the end. -- and not use
> the shell but use 'parallel', which spawns processes directly, so I
> don't have to worry about expansion --
> (I could have it do expansion by running it with bash -c "command",
> but if expansion is causing a problem
> its a bonus not to incur running a command shell with each iteration).... 

> base
 wget -B $(<base) -i file
works too

reply via email to

[Prev in Thread] Current Thread [Next in Thread]