bug-bash
[Top][All Lists]
Advanced

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

Re: docs incorrectly mention pattern matching works like pathname expans


From: Stormy
Subject: Re: docs incorrectly mention pattern matching works like pathname expansion
Date: Fri, 16 Mar 2018 09:38:50 +0000 (UTC)

Thanks, however, I'm not aware how 'echo' can be used as a comparison tool in 
bash..  i thought it only prints text..  see my other email showing examples of 
inputs.. from searching online, folks said that bash does not have 'fnmatch' 
functionality for pathname expansion, it only has standard pattern matching, 
i.e. 'case' '[[ $a == $b ]]', etc.
anyways, I don't expect you guys to help beyond what u've already did.. if 
someone knows a solution, sure, otherwise, it's all good, my small fnmatch 
function seems to do the right thing thus far... :)
 

    On Friday, March 16, 2018, 3:03:14 AM GMT+2, PePa 
<peterkelly@passchier.net> wrote:  
 
 I think bash's echo does this, it doesn't do the pattern matching like
case, the slashes need to be there. You might need/want `shopt -s
dotglob nullglob`

Peter

On 03/16/2018 05:52 AM, Stormy wrote:
> ok, thanks for the confirmation.  now u see what I meant before.. when saying 
> bash does not have a builtin way to call fnmatch (I meant: for path name 
> matching), clearly bash calls fnmatch, that is obvious, but there is no way 
> to make it do pathname matching internally. (cd, ls, will surely do it, 
> external to bash though)..
> 
> anyways, thanks for all the help..
>  
> 
>    On Thursday, March 15, 2018, 9:44:38 PM GMT+2, Chet Ramey 
><chet.ramey@case.edu> wrote:  
>  
>  On 3/15/18 3:26 PM, Stormy wrote:
> 
>> like I said, I've already implemented, roughly 40 lines in bash, and it
>> seems to work, but if there is some builtin option 'shopt' or similar that
>> can turn the right flags you mentioned, I'm all for testing it :)
> 
> There isn't. Pathname expansion is done in the specific circumstances Posix
> says it should be (and historical shells perform). The other contexts use
> straight pattern matching.
> 
> 
  

reply via email to

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