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

Re: dpkg -l ?



On Fri, Apr 25, 2003 at 03:58:41PM -0500, David Krider wrote:
> Why does this give me nothing:
> 
> -----------------------------------------------
> tyrannus:/etc# dpkg -l kernel-*
> No packages found matching kernel-img.conf.
> No packages found matching kernel-pkg.conf.

You're in a directory that happens to contain files called
kernel-img.conf and kernel-pkg.conf, and you're using an unescaped shell
wildcard (the *) so the shell expands kernel-* to those two filenames.

To prevent this, quote the *, either like this:

  dpkg -l kernel-\*

... or like this:

  dpkg -l 'kernel-*'

> While this works?
> 
> -----------------------------------------------
> tyrannus:/etc# dpkg -l kernel-d*

bash's default is for the 'nullglob' option to be disabled, which means
that if a wildcard doesn't match it is left as is. You have no files
that match kernel-d* in the current directory, so kernel-d* is passed
straight through as an argument to dpkg.

You should always quote special characters like * for the shell if
you're expecting programs other than the shell to see them.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: