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

Re: The "*" character (was: Latex )



On Thu, 08 Aug 1996 10:34:27 +1000 Mark Phillips (mark@maths.flinders.
edu.au) wrote:
> >It would be helpful if you could tell us what version of the packages
> >you have installed.  For example, if you would run this commands:
> >
> >      dpkg -l *tex*
> 
> I noticed that this doesn't work under tcsh, but does work under
> bash.  Is there a difference between how the * character is treated
> under the two shells?

By default, bash expands shell metacharacters (*?[]) only if they're a match ({} rules are the exception, they're always expanded). Otherwise, bash passes the metacharacters to the invoked program.
Tcsh will complain and abort if it cannot expand some metacharacters. You need to quote them.

Solution: always quote shell metacharacters when you want to pass them to a program.

Phil.




Reply to: