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

Re: wget file name is too long



Erik Xavior wrote:
> Hi!
>
> I've got a little script, what gives wget some URLs to download, the
> URL-s are not soo long, but, the URL's are redirected, then they are
> too long:
>
> wget $(script)
>
> Cannot write to
> something?attredirects=0auth=ANoY7cqi24QEtZt9tVRYpcBnR5N5Y6sU0eERgXUdKmJCYKN7thBmfdghjfdsdo6ihFwUpTG1Wmtp4qjzZmwT89LWaDNKZVMJt55_cf7jiH_OK1ksL4CsunFBVObD4aRF3JvyouZ2xkjM2-X1mqwWyUisM8BkR5w_rdhfbgvhjdkertjuhfzdjrktgjhfdnfmjhg6aT1xC4PgIjg=='
> (File name too long).
>
>
> If it would be only one file/URL, I could use the "wget -O filename"
> option, but in this case, I have a number of URL's from a script
> The only static thing I see here, is that the long URL's are usually
> like this: "filename?saadlfjanvyxhvuasdhrarf" so they're separated by
> a question mark
>
> I read mailing list like:
> http://www.mail-archive.com/wget@sunsite.dk/msg07322.html
>
> and it say's theres a wget option:
> -tc, --trimcharacter char cut filename after character, such as "_"
>
>
> but it doesn't work for me, and I got a question mark (?) for separator
>   

How are you passing this option? '?' is a shell meta-character, so you
should use something like
wget -tc '?'
to prevent expansion.

> could anyone give any tips? :)

The --content-disposition option could also help.

-- 
Home is the place where, when you have to go there, they have to take you in.
		-- Robert Frost, "The Death of the Hired Man"

Eduardo M KALINOWSKI
eduardo@kalinowski.com.br


Reply to: