Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #231267

Re: problem with wget -O

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: problem with wget -O
Date 2021-01-29 18:00 +0100
Message-ID <BCFhL-Kl-1@gated-at.bofh.it> (permalink)
References (1 earlier) <BBt90-4pg-11@gated-at.bofh.it> <BBt90-4pg-9@gated-at.bofh.it> <BBuHL-5ud-9@gated-at.bofh.it> <BCi1Q-3FA-15@gated-at.bofh.it> <BCibv-3IR-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 28 Jan 2021 at 11:10:48 (-0500), Greg Wooledge wrote:
> On Thu, Jan 28, 2021 at 10:06:25AM -0600, David Wright wrote:
> > Perhaps file a bug against that page. It appears that they were using
> > -O merely to avoid overwriting http://master.zip with the second instance of
> > wget. The manpage expressly advises against doing that: "Use of -O is
> > not intended to mean simply "use the name file instead of the one in
> > the URL". They should just use mv after each wget to place the zip
> > files where they want them.
> 
> If -O is bad, then what are you supposed to use instead?

--no-config has already been mentioned by a couple of people.
There's also -nc which makes the command fail if the output
file already exists. There's even --backups which can move
existing files out of the way. I think wget has options
enough for most people's taste.

> If you need to "use mv after each wget", how do you know the name of the
> file that wget used?  And why can't you simply tell wget to use the
> filename you *want* it to be written to?

When running wget interactively, the name gets written on the
screen. When writing a script, one might check for a pre-existing
file (before) or discover the new file's name from stderr (after).

I looked at the instructions in question at
https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
and it wasn't clear to me whether the Code examples were designed
as Instructions to follow or Scripts to cut/paste.

> Why would you need to do this
> weird two-step process?

For similar reasons that one types   cd foo   at the console,
but puts   cd foo || exit   in a script; or trains one's fingers
to type "mv -i" and "rm -i" as a matter of habit.

BTW I downloaded one of the files Gene mentioned by typing
$ wget https://github.com/opencv/opencv/archive/master.zip
and ended up with master.zip.1 because I had downloaded an
unrelated project from git 3 weeks ago. Renaming was the
usual result of relying on wget's reasonable defaults.

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: problem with wget -O Roberto C. Sánchez <roberto@debian.org> - 2021-01-25 19:50 +0100
  Re: problem with wget -O Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-25 20:00 +0100
    Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 21:20 +0100
      Re: problem with wget -O Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-25 21:40 +0100
        Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 21:50 +0100
          Re: problem with wget -O Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-25 22:00 +0100
            Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 22:10 +0100
              Re: problem with wget -O Darac Marjal <mailinglist@darac.org.uk> - 2021-01-25 22:50 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 23:40 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 23:40 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-26 00:00 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-26 00:10 +0100
                Re: problem with wget -O <tomas@tuxteam.de> - 2021-01-26 10:50 +0100
                Re: problem with wget -O l0f4r0@tuta.io - 2021-01-26 13:40 +0100
                Re: problem with wget -O <tomas@tuxteam.de> - 2021-01-26 14:50 +0100
              Re: problem with wget -O Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-25 23:10 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 23:50 +0100
                Re: problem with wget -O Vincent Lefevre <vincent@vinc17.net> - 2021-01-26 10:50 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-26 12:30 +0100
                Re: problem with wget -O Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-26 13:40 +0100
                Re: problem with wget -O Vincent Lefevre <vincent@vinc17.net> - 2021-01-26 15:00 +0100
                Re: problem with wget -O Celejar <celejar@gmail.com> - 2021-01-26 15:10 +0100
                Re: problem with wget -O Vincent Lefevre <vincent@vinc17.net> - 2021-01-26 14:50 +0100
                Re: problem with wget -O David Wright <deblis@lionunicorn.co.uk> - 2021-01-28 17:10 +0100
                Re: problem with wget -O Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-28 17:20 +0100
                Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-28 21:10 +0100
                Re: problem with wget -O Brian <ad44@cityscape.co.uk> - 2021-01-28 22:00 +0100
                Re: problem with wget -O David Wright <deblis@lionunicorn.co.uk> - 2021-01-29 18:30 +0100
                Re: problem with wget -O rhkramer@gmail.com - 2021-01-29 18:40 +0100
                Re: problem with wget -O David Wright <deblis@lionunicorn.co.uk> - 2021-01-29 18:00 +0100
                Re: problem with wget -O Vincent Lefevre <vincent@vinc17.net> - 2021-01-26 10:50 +0100
    Re: problem with wget -O Nicolas George <george@nsup.org> - 2021-01-26 12:40 +0100
      Re: problem with wget -O <tomas@tuxteam.de> - 2021-01-26 13:20 +0100
  Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 21:10 +0100
    Re: problem with wget -O Roberto C. Sánchez <roberto@debian.org> - 2021-01-25 21:20 +0100
      Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 21:40 +0100
    Re: problem with wget -O deloptes <deloptes@gmail.com> - 2021-01-25 21:20 +0100
      Re: problem with wget -O Gene Heskett <gheskett@shentel.net> - 2021-01-25 21:30 +0100
        Re: problem with wget -O deloptes <deloptes@gmail.com> - 2021-01-26 00:20 +0100

csiph-web