Re: [SLUG] dot's function in *nix

From: Ed Centanni (ecentan1@tampabay.rr.com)
Date: Mon Dec 31 2001 - 00:41:08 EST


apropos (a.k.a. man -k) takes a regular expression (.) as an argument
instead of a filename wildcard (*) since it is searching for a string
match and not a filename match. Filename wildcards and regular
expressions are not the same thing. The '.' in "./myscript" is a kind
of shorthand for a bonafide directory name and is neither a wildcard nor
regular expression.

When you give the commmand "apropos *", you are actually feeding apropos
a list of all the filenames in the current directory to be evaluated as
regular expressions. That's why you get strange results.

See the manual pages for grep (man grep) for more info on regular
expressions.

Ed.

Mario Lombardo wrote:

> In the thread subject 'A "whatis" catalog', I was once again mystified
> by the use of the dot in Unix-like systems. I originally thought the
> use of dot was merely to state "here" or "from here" as in the example
> of filesytems use:
>
> ls .
> sh ./myscript
>
> But the dot turned out to be more than that when I saw people using it
> in other ways; most recently from Ed Centanni's REply to my question
> with this as the best working model:
>
> apropos . | sort > mycatalog.txt
> versus...
> apropos * | sort > mycatalog.txt
>
> I don't understand the literal interpretation of the dot in this example
> versus using an asterisk. Actually, an asterisk doesn't discover as
> many commands as the dot. In fact, doing a search for the command chfn
> doesn't come up in the asterisk solution, yet it comes up in the dot
> solution. This seems opposite of what would work in the DOS
> world--which is my background.
>
> URL reading sources are fine. I just want to understand how to utilize
> this little gem in other ways...if there are any more.
>
> Thanks,
> Mario
>



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:27:50 EDT