zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: Fw: poor man's wget
Date: Tue, 30 May 2000 16:35:40 +0400	[thread overview]
Message-ID: <LCEMLEBGJOFBDGPICJKGEEJACAAA.Andrej.Borsenkow@mow.siemens.ru> (raw)


I found it on c.u.s

Amusing is it :-)

-andrej

"brian hiles" <bsh@rainey.blueneptune.com> wrote in message
news:<sj2npdk15pj111@corp.supernews.com>...
> Martin Ramsch <m.ramsch@computer.org> wrote:
> > I only now discovered the special handling of redirections to
> > /dev/tcp/host/port introduced with Bash 2.x, and I like this small
> > contruct which requests the main page from a web server:
> >   { echo "GET /" >&0; cat; } <>/dev/tcp/www.server.com/80
> > Also the first time a "<>" redirection is useful for me ... ;-)
>
> The /dev/{tcp,udp} special notation is a reflection of the same
> feature introduced in ksh93 (at least I think I'm getting the
> relationship correct!) BTW, "<>" is an undocumented feature of
> plain ol'd bourne shell since, well, _forever_.
>
> Jeffery Korn (yes, son of _that_ guy) posted a similar solution two
> years of so back to this newsgroup.
>
> Apparently, however, bash 2.x does ksh93 one better by not requiring
> the <hostname> address to be resolved to an IP address. Kudoes to
> the bash development team :)
>
> Incidentally, I would rephrase the above as:
>
> { echo GET /; echo; cat; } <>/dev/tcp/www.server.com/80
>
> Isn't the additional newline necessary? (Not tested.)
>
> It's quite amusing to determine the time from a daytime server:
>
> read -r </dev/udp/0.0.0.0/13; print -r -- "$REPLY"
>
> -Brian


             reply	other threads:[~2000-05-30 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-30 12:35 Andrej Borsenkow [this message]
2000-05-30 15:05 ` Peter Stephenson
2000-05-30 15:57   ` Zefram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=LCEMLEBGJOFBDGPICJKGEEJACAAA.Andrej.Borsenkow@mow.siemens.ru \
    --to=andrej.borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).