24

I noticed a script using wget -Y off ...(bunch of stuff)... which I hadn't encountered before.

Looked it up in the man page and in wget --help and found nothing.

But it definitely exists as an option; contrast it with the non-existent option -Z:

# wget -Y
wget: option requires an argument -- 'Y'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

wget -Z

wget: invalid option -- 'Z' Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

wget --help | grep -- -Y

What is this undocumented option?

Wildcard
  • 36,499
  • It is likewise not documented in the info page at https://www.gnu.org/software/wget/manual/wget.html – Wildcard Oct 12 '23 at 23:28
  • 2
    UTSL -- Use the Source, Luke! – Kaz Oct 13 '23 at 09:13
  • 3
    FWIW, busybox's wget implementation (used, for example, in alpine) still has the option: -Y on/off Use proxy (and it's missing --no-proxy) – Geier Oct 13 '23 at 12:34
  • @Geier that's quite relevant as the script I saw using this is a debian installer script (in a foreman provisioning template) that actually runs on busybox. It uses wget -Y off ... to fetch the "finish" script from foreman, that is then run "in-target" (with access to normal non-busybox utilities). – Wildcard Oct 13 '23 at 18:41

1 Answers1

34

A bit of digging turned up the relevant commits:

Apparently -Y is an ancient switch preserved only for backward compatibility, that allows turning the use of a proxy off (or on??).

The modern replacement for -Y off appears to be --no-proxy which is documented in the current manual as:

       --no-proxy
           Don't use proxies, even if the appropriate *_proxy environment variable is defined.
psmears
  • 465
  • 3
  • 8
Wildcard
  • 36,499