help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Filename Expansion: Find Utility vs Bash Shell Pattern M


From: Stephane Chazelas
Subject: Re: [Help-bash] Filename Expansion: Find Utility vs Bash Shell Pattern Matching
Date: Thu, 18 Jun 2015 16:59:54 +0100
User-agent: Mutt/1.5.21 (2010-09-15)


2015-06-18 10:21:03 -0400, Greg Wooledge:
> On Thu, Jun 18, 2015 at 02:40:23PM +0100, Stephane Chazelas wrote:
> > Not to mention that those globs (which have been in Unix for
> > over 45 years old) are universally found including in MS-DOS for
> > decades.
> 
> MS-DOS globs are not the same.  I can think of at least two significant
> differences off the top of my head:
> 
> 1) MS-DOS filenames have two parts, and your glob must specify both parts.
>    For example, a glob of * will not match all files in the current
>    directory; it will only match all files where the second part (the
>    "extension") is empty.  To match all files you must use *.* .
> 
> 2) Characters following a * within a filename part are ignored.  *a.txt
>    and *.txt both match the same set of files, because in the first glob,
>    the "a" character is ignored.
> 
> (I'm not including the case insensitivity of MS-DOS because that's
> consistent all the way down to the file system, not just in globs.)
> 
> There may be other differences.  I haven't worked with MS-DOS in a long
> time.

Yes, you're right, from
https://en.wikipedia.org/wiki/Glob_%28programming%29#Syntax it
looks like they're completely different. I should have guessed
that they wouldn't be able to copy it properly.

-- 
Stephane




reply via email to

[Prev in Thread] Current Thread [Next in Thread]