rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Alan Watson <alan@oldp.astro.wisc.edu>
To: John (Most modern computers would break if you stood on them)
	Mackin <john@ civil.su.oz.au>
Cc: rc@hawkwind.utcs.toronto.edu
Subject: Re: here strings
Date: Sat, 5 Jun 1993 12:42:48 -0400	[thread overview]
Message-ID: <9306051642.AA00477@oldp.astro.wisc.edu> (raw)

Sorry, John, but I'm not convinced by your example, although there may
be something I have missed.

The precise behaviour of your example can be reproduced by:

   for ( f in * ) mv $f `{ echo -n $f | tr A-Z a-z }

assuming echo is built-in (or an external, non-SYSV echo).  I strongly
suspect that your here-string solution is not very much faster than
this one, if echo is a built-in command.  So, I would tentatively class
your idiom as a speed hack on a system without a built-in echo (like
some of the means of getting at the file system through the globber and
builtin cd).

As I see it, the justification for here-strings is that echo is not a
necessarily available as a built-in, and so one cannot reliably convert
a here-document to a a series of echoes.


             reply	other threads:[~1993-06-05 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-06-05 16:42 Alan Watson [this message]
     [not found] <john@civil.su.oz.au>
1993-06-07  8:42 ` malte
  -- strict thread matches above, loose matches on Subject: below --
1993-06-05 12:53 malte
1993-06-05 12:55 ` John Mackin
1993-06-05 12:35 John Mackin

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=9306051642.AA00477@oldp.astro.wisc.edu \
    --to=alan@oldp.astro.wisc.edu \
    --cc=john@civil.su.oz.au \
    --cc=rc@hawkwind.utcs.toronto.edu \
    /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.
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).