Re: Bash commands: maybe they want to drive us crazy?

From: Bill Unruh (unruh_at_string.physics.ubc.ca)
Date: 06/30/04


Date: Wed, 30 Jun 2004 19:10:28 +0000 (UTC)

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]

]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.



Relevant Pages

  • Re: MacTeX 2007 and documentation
    ... may be the most useful command available when doing searches at the ... will find every file on your system that has the text "memoir" on it, ... If locate generates 30 lines of text, where each line is a file, grep ... I need a Unix guru to chat to for half an hour or so to put me straight. ...
    (comp.text.tex)
  • Re: piping multiple selections to mv or cp and exclusion
    ... pipe to shell to execute each command statement ... Unix is indeed lifelong learning :-) ... and the regexp. ... back into the grep statement. ...
    (comp.unix.shell)
  • Re: MacTeX 2007 and documentation
    ... means you need expertise in your host operating system as well. ... locate memoir | grep pdf ... I'm not someone who lives at the command line, ...
    (comp.text.tex)
  • Re: Program to scan directories
    ... Is there a UNIX command which scans directories and execute any other ... the regex you specify here is /not/ given to grep to ... entries (files and subdirectories). ... tell grep to recurse through the kpathsea directory (the *.h regex ...
    (comp.unix.programmer)
  • Re: Using the grep command to filter
    ... I am a college student currently enrolled in a Unix class. ... that ubuntu Ubuntu UBUNTU ubunTU whatever in them. ... grep ubuntu /etc/* of course. ... Now look at the output of that grep command will give you all the ...
    (comp.unix.shell)