[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: What could cause this situation?

On Sun, 14 Dec 2003 13:27:30 -0800 (PST)
Leila Lappin <damovand@yahoo.com> wrote:

> Yes thank you all around again,

No probl =)

> rpm -qa | grep -i mysql did it.  That showed me all
> the installed packages.  Then I was able to get more
> information about each package.  As it turns out I
> have MySQL-Max-4.0.12-0 and MySQL-server-4.0.12-0
> installed.  I remember installing only one, but I'm
> not complaining as long as the client program uses the
> right server and I can do future upgrade with no
> problem. Anyway, the funny thing is, I had done rpm
> -qa | grep mysql* and as you pointed out had gotten
> the wrong results.

Actually, it was not grep which was misleading you, it was the shell.
Once you understand that commands only execute after the shell has
processed all the tokens, things become much clearer. On your case, the
shell expands the '*' before grep sees it, and what happens is that grep
ends up receiving different args than the ones you thought it was going
to use.

> I have been using grep for years and I never knew what
> you pointed out.  Quite humbling.

I am affraid you probably have been getting wrong grep results all this
time... besides 'man bash', this nice doc could prove to be extremely
helpful: 'Advanced Bash Scripting Guide'. Very nice piece of
documentation, you will find it on www.tldp.org under 'Guides' (can't
give you the exact URL right now because TLDP seems to be down).



Andre Oliveira da Costa

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]