Re: Bash commands: maybe they want to drive us crazy?
From: Floyd L. Davidson (floyd_at_barrow.com)
Date: 06/30/04
- Next message: Kimmo Koivisto: "Re: how read from LPT port with C++ on the RedHat?"
- Previous message: Nick Landsberg: "Re: Bash commands: maybe they want to drive us crazy?"
- In reply to: Bill Unruh: "Re: Bash commands: maybe they want to drive us crazy?"
- Next in thread: GP: "Re: Bash commands: maybe they want to drive us crazy?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Jun 2004 13:17:28 -0800
unruh@string.physics.ubc.ca (Bill Unruh) wrote:
>GP <gilpel@inverse.nretla.org> writes:
>
>>Here's how to make a grep:
>
>>grep [options] PATTERN [FILE...]
>
>>Ex.:
>>grep -ir IPv6 .
>
>>Here's how to make a find:
>
>>find [path...] [expression]
>
>No. find [path] [options]
That isn't what the man page says... and the man page is
*correct*, if GP would merely read past the first couple
lines:
SYNOPSIS
find [path...] [expression]
EXPRESSIONS
The expression is made up of *options* (which affect
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
overall operation rather than the processing of a
specific file, and always return true), tests (which
return a true or false value), and actions (which have
side effects and return a true or false value), all
separated by operators. ...
(Emphasis added.)
Here is the man page SYNOPSIS for grep,
grep [options] PATTERN [FILE...]
What GP needs to see is the basic difference, where there may be
multiple options, tests, and actions listed for /file/, there might
be multiple files with /grep/. That last argument needs to be
whichever entity is going to accept multiples.
(I've not trimmed the rest of Bill's excellent discussion, just
because GP needs to read it again! There's a message there...
which says this may be a little complex, but it *is* the best
way to get that kind of functionality! Not seeing the reasoning
in a cursory examination doesn't mean there is not a valid
reason. It just means UNIX wasn't haphazardly designed without
looking past the obvious.)
>>find -iname . "*IPv6*"
>
>-iname is an option which takes one argument. That argument to
>the option in this case is '*IPV6*' (NOT "*IPv6*" because the
>latter would cause the shell to expand the *s, not find) It is
>NOT an argument to find, it is an argument to the option
>-iname.
>
>Your format would make no sense whatsoever and would not correspond to any
>format of any command.
>
>>Oups! Doesn't work! No mention of options in the arrrg... SYNOPSIS! Here's how
>>it should have been written:
>
>>find [path...] [options] [expression]
>
>NO NO NO.
>find path [options]
>
>Find has no expression as an argument.
>
>>find . -iname "*IPv6*"
>
>> From find to grep, everything is upside down.
>
>No. The only thing backwards is that he path is first, because it would be
>far to easy to loose sight of the path with a long list of options.
>
>>[expression], which corresponds to PATTERN is at the end rather than in the middle.
>
>There is no pattern. There is an argument to various options.
>
>>[options] is in the middle instead of at the beginning.
>
>>[path...], which corresponds to FILE is at the beginning rather than at the end.
>
>>Microsoft "suits" wouldn't let this happen.
>
>?? They do not let commands happen. It is very difficult to run a command
>in MS, and then the syntax is all over the place, and sometimes different
>from Unix where they took it from.
-- FloydL. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik (Barrow, Alaska) floyd@barrow.com
- Next message: Kimmo Koivisto: "Re: how read from LPT port with C++ on the RedHat?"
- Previous message: Nick Landsberg: "Re: Bash commands: maybe they want to drive us crazy?"
- In reply to: Bill Unruh: "Re: Bash commands: maybe they want to drive us crazy?"
- Next in thread: GP: "Re: Bash commands: maybe they want to drive us crazy?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|