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

From: Jim Wildman (jim@rossberry.com)
Date: Mon Dec 31 2001 - 00:07:38 EST


The difference is dot in a command shell context (ls . or ./myscript)
where is means the current directory versus dot in a regulat expression
context (apropos .) where it matches any single character. And of
course it can also be used in filenames as a normal character..

try this
mkdir tmp
cd tmp
touch t
touch tt
ls | grep "."
ls | grep ".."

------------------------------------------------------------------------
Jim Wildman, CISSP jim@rossberry.com
817-308-3868 http://www.rossberry.com

On Sun, 30 Dec 2001, 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:28:01 EDT