9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Dan Cross <cross@math.psu.edu>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] 'find'
Date: Sun, 29 Jun 2003 14:42:14 -0400	[thread overview]
Message-ID: <200306291842.h5TIgE703166@augusta.math.psu.edu> (raw)
In-Reply-To: Your message of "29 Jun 2003 11:11:13 PDT." <1056910273.2840.11.camel@localhost.localdomain>

> On Sun, 2003-06-29 at 09:57, D. Brownlee wrote:
> > 	grep pattern `{du -a /}
>
> This is a general scripting question.
>
> I've been berated for my admittedly poor command usage, namely for
> excessive usage of the "useless cat" and similar techniques:
>
> 	cat foo | grep pattern

There are times when the ``useless cat'' is actually quite useful.  For
instance, when one wants to pipe more than one file to tr and the files
are passed as command line arguments.  Doing the logic to figure out
whether you need cat or not would be more expensive than just using cat
in all cases.

> namely because when I change my mind I've always found it easier to
> change the end of a line rather than some arbitrary section of the
> middle (whether using some other shell's history or sweeping with the
> mouse).

I do this on the command line all the time.  In scripts, not so
frequently.

> Is anyone else prone to this problem, or do you have some other
> technique that satisfies your own personal laziness or ineptitude?

Usually, I just give up and go get a cup of coffee or something
instead.

But seriously, complaints about the useless cat are often overblown,
and not using cat often makes the resulting script really ugly.  This
isn't 1985; I'll pick a cleaner more maintainable script over saving
a process.

	- Dan C.



  reply	other threads:[~2003-06-29 18:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-29 16:57 D. Brownlee
2003-06-29 16:59 ` Sape Mullender
2003-06-30 14:07   ` rog
2003-06-30 14:18     ` Scott Schwartz
2003-06-30 14:50       ` rog
2003-07-03  9:42         ` Douglas A. Gwyn
2003-07-03 10:03           ` Fco.J.Ballesteros, nemo
2003-07-03 15:14             ` rob pike, esq.
2003-07-03 12:57           ` matt
2003-07-03 16:59             ` Douglas A. Gwyn
2003-07-03 17:09               ` matt
2003-06-30 15:30       ` Dan Cross
2003-07-03 12:11     ` Kenji Arisawa
2003-06-29 18:11 ` Jack Johnson
2003-06-29 18:42   ` Dan Cross [this message]
2003-07-04 14:08   ` Ralph Corderoy
2003-07-05 18:38     ` Dan Cross
2003-07-06  3:11       ` boyd, rounin
2003-07-07  8:33         ` Douglas A. Gwyn
2003-07-07 10:49           ` boyd, rounin
2003-07-07 14:05             ` Douglas A. Gwyn
2003-07-07 15:46           ` rob pike, esq.
2003-07-07 19:18             ` Dan Cross
2003-07-07 19:26               ` David Presotto
2003-07-07 19:46                 ` Dan Cross
2003-07-07 19:08           ` Dan Cross
2003-07-07 19:21             ` Dan Cross
2003-07-08  8:31               ` Douglas A. Gwyn
2003-07-08 11:20                 ` Dan Cross
2003-07-06 16:12       ` Jack Johnson
2003-07-06 22:20       ` matt
2003-07-07 13:28       ` Ralph Corderoy
2003-07-07 19:13         ` Dan Cross
2003-06-30  7:47 ` Fco.J.Ballesteros, nemo
2003-06-30  7:55   ` boyd, rounin
2003-06-30 14:32 ` Dan Cross

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=200306291842.h5TIgE703166@augusta.math.psu.edu \
    --to=cross@math.psu.edu \
    --cc=9fans@cse.psu.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).