bug-bash
[Top][All Lists]
Advanced

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

Bash extended glob - Negation


From: Inian Vasanth
Subject: Bash extended glob - Negation
Date: Fri, 30 Apr 2021 12:28:32 +0530

Configuration Information:
Machine: x86_64
OS: darwin20.2.0
Compiler: clang
Compilation CFLAGS: -DSSH_SOURCE_BASHRC
uname output: Darwin C02YW0DVLVCH 20.3.0 Darwin Kernel Version 20.3.0: Thu
Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin20.2.0

Bash Version: 5.1
Patch Level: 4
Release Status: release

Description:

A wildcard expression after a negate extglob construct is not returning
right results.

Steps

Consider the following files and assume, that I want to exclude files
ending with 8

shopt -s extglob
touch atop_20210330 atop_20210427 atop_20210428
ls -1 atop_20210@(3|4)+([0-4])!(8)
atop_20210330
atop_20210427

But when I add an extra * at the end of the expression like

ls -1 atop_20210@(3|4)+([0-4])!(8)*
atop_20210330
atop_20210427
atop_20210428

Why is it the case? Shouldn't the glob expression just serve the !(8)
pattern to exclude and simply do a no-op for the extra * character?


-- 
Regards,
INIAN VASANTH P


reply via email to

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