bugGNU Wget - Bugs: bug #20520, wget -O - $URL says `-' saved but...

 
 

bug #20520: wget -O - $URL says `-' saved but there is no file -

Submitter:  Noël Köthe <nok>
Submitted:  Wed 18 Jul 2007 07:41:17 PM UTC
   
 
Category:  User Interface Severity:  3 - Normal
Priority:  2 Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  1.10.2 Operating System:  GNU/Linux
Reproducibility:  None Fixed Release:  1.12
Planned Release:  1.15 Regression:  None
Work Required:  0 - Hours Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 03 Mar 2009 09:52:18 PM UTC, comment #6: 

Likewise fixed for FTP retrievals in 63ba1b289aa0

Steven Schubiger <schubiger>
Group Member
Mon 23 Feb 2009 08:47:15 PM UTC, comment #5: 

Fixed in 672d48697991

Micah Cowan <micahcowan>
Thu 27 Nov 2008 06:29:16 AM UTC, comment #4: 

Thanks, Michael.

Actually, Noël's familiar with that issue: he's just complaining that Wget claims to save to a file named "-" when it actually saves to stdout.

Really, a simple fix to patch, but also quite low-pri.

Micah Cowan <micahcowan>
Thu 27 Nov 2008 03:03:53 AM UTC, comment #3: 

hi, I think there might be a confussion about the meaning of -

to write to a file named - one should write to ./- instead, that's not a problem from wget it's the normal way - is interpreted (as an alias of stdout).

so:
$ LC_ALL=C wget -O ./- ix.de
--2008-11-27 00:49:03--  http://ix.de/
Resolving ix.de... 193.99.144.80
Connecting to ix.de|193.99.144.80|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.heise.de/ix/ [following]
--2008-11-27 00:49:04--  http://www.heise.de/ix/
Resolving www.heise.de... 193.99.144.85
Connecting to www.heise.de|193.99.144.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `./-'

    [     <=>                                                                                                ] 29,184      21.7K/s   in 1.3s   

2008-11-27 00:49:06 (21.7 KB/s) - `./-' saved [29184]

$ ls -la
total 41
-rw-r--r--   1 samus users 29184 2008-11-27 00:49 -
drwxr-xr-x   2 samus users    72 2008-11-27 00:49 .
drwx--x--x 117 samus users  9640 2008-11-27 00:47 ..

when you write to - you're using it as an alias of stdout, which will print the page to the console directly. I don't think this is useless since the rest the output is correctly sent to stderr so there's no mixing, you can handle them separately.

a real world example might be: http://www.linuxquestions.org/questions/linux-software-2/desktop-wallpaper-changer-646084/#post3243438 and the use of -q is independent of the use of -O- imho.

as for the messages sent, here's the output I see (v1.11.4):
$ LC_ALL=C wget -O - ix.de >/dev/null
--2008-11-27 00:55:45--  http://ix.de/
Resolving ix.de... 193.99.144.80
Connecting to ix.de|193.99.144.80|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.heise.de/ix/ [following]
--2008-11-27 00:55:46--  http://www.heise.de/ix/
Resolving www.heise.de... 193.99.144.85
Connecting to www.heise.de|193.99.144.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `STDOUT'

    [     <=>                                                                                                ] 29,150      21.4K/s   in 1.3s   

2008-11-27 00:55:48 (21.4 KB/s) - `-' saved [29150]

(yet another example that uses -O- and not requires -q) it first says "Saving to: `STDOUT'" and then "`-' saved" which is probably not the clearest message but it's understandable I think.

Michael <samus_>
Sun 03 Feb 2008 05:26:59 AM UTC, comment #2: 

If Micah understood this correctly, does it even matter? Saving to standard output only works with the -q option anyway (unless you want everything mixed together, which would have disastrous effects).

John Doe <yurimxpxman>
Wed 18 Jul 2007 08:12:24 PM UTC, comment #1: 

Are you saying you wish the message from wget to say "written to standard output", rather than "saved to `-'"?

Micah Cowan <micahcowan>
Wed 18 Jul 2007 07:41:17 PM UTC, original submission:  

Hello,


$ LC_ALL=C wget -O- ix.de
--21:37:41--  http://ix.de/
           => `-'
Resolving ix.de... 193.99.144.80
Connecting to ix.de|193.99.144.80|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.heise.de/ix/ [following]
--21:37:42--  http://www.heise.de/ix/
           => `-'
Resolving www.heise.de... 193.99.144.85
Connecting to www.heise.de|193.99.144.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

    [<=>                                                                      ] 0             --.--K/s            


...

    [  <=>                                                                    ] 27,404        71.27K/s            

21:37:45 (71.03 KB/s) - `-' saved [27404]

$ ls -la
insgesamt 20
drwxr-xr-x  2 nk   nk    4096 2007-07-18 21:27 .
drwxrwxrwt 13 root root 16384 2007-07-18 21:32 ..

there is no file with the name "-".

Noël Köthe <nok>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by schubiger (Updated the item)
  • -email is unavailable- added by samus_ (Posted a comment)
  • -email is unavailable- added by yurimxpxman (Posted a comment)
  • -email is unavailable- added by micahcowan (Posted a comment)
  • -email is unavailable- added by nok (Submitted the item)
  •  

    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-03-03 schubiger StatusIn Progress Fixed
        Assigned toschubiger None
        Open/ClosedOpen Closed
    2009-02-26 schubiger StatusFixed In Progress
        Open/ClosedClosed Open
    2009-02-23 micahcowan StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 1.12
    2009-02-18 schubiger StatusNeed Info In Progress
        Assigned toNone schubiger
    2008-01-27 micahcowan Planned Release1.12 1.15
    2007-08-01 micahcowan Priority5 - Normal 2
    2007-07-20 micahcowan Work RequiredNone 0 - Hours
    2007-07-20 micahcowan Planned ReleaseNone 1.12
    2007-07-18 micahcowan StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code