|
From: | GNU bug Tracking System |
Subject: | bug#69261: closed ('ls' : --ignore does not apply on FILEs selection) |
Date: | Mon, 19 Feb 2024 06:46:01 +0000 |
Your message dated Sun, 18 Feb 2024 22:45:00 -0800 with message-id <1e3795ac-d6cd-4b88-ab4b-9dcf6e8d595b@cs.ucla.edu> and subject line Re: bug#69261: 'ls' : --ignore does not apply on FILEs selection has caused the debbugs.gnu.org bug report #69261, regarding 'ls' : --ignore does not apply on FILEs selection to be marked as done. (If you believe you have received this mail in error, please contact help-debbugs@gnu.org.) -- 69261: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69261 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems
--- Begin Message ---Subject: 'ls' : --ignore does not apply on FILEs selection Date: Sun, 18 Feb 2024 22:07:39 +0000 User-agent: Horde Application Framework 5 Hello,
Is it expected that --ignore arg does not apply on globbed FILE ?
My goal is to avoid using grep or complex find args:
> ~/.ssh :: ls id_ed* | grep -v "\.pub$"
id_ed25519
id_ed25519.local
id_ed25519_ori> ~/.ssh:: find . '!' -name '*.pub' -name "id_ed*"
./id_ed25519_ori
./id_ed25519.local
./id_ed25519
I tried -I (--ignore) and --hide :> ~/.ssh:: ls -I"*.pub" id_ed*
id_ed25519 id_ed25519.local id_ed25519.local.pub id_ed25519_ori id_ed25519_ori.pub id_ed25519.pub
> ~/.ssh:: ls --hide "*.pub" id_ed*
id_ed25519 id_ed25519.local id_ed25519.local.pub id_ed25519_ori id_ed25519_ori.pub id_ed25519.pubSince help text says for both options is :
do not list implied entries matching shell PATTERNI would expect it to occur after building the initial listing.
When I remove the globbing pattern, it seems to work as expected:
~/.ssh:: ls -I "*.pub" ./
config id_ed25519 id_ed25519.local id_ed25519_ori id_rsa.local known_hosts known_hosts.old
~/.ssh:: ls -I "*.pub"
config id_ed25519 id_ed25519.local id_ed25519_ori id_rsa.local known_hosts known_hosts.oldMan page says nothing about conflicts with file globbing.
My view is obviously that this is a miss, what are yours ?Thanks for your feedback
--Mathias M
--- End Message ---
--- Begin Message ---Subject: Re: bug#69261: 'ls' : --ignore does not apply on FILEs selection Date: Sun, 18 Feb 2024 22:45:00 -0800 User-agent: Mozilla Thunderbird On 2024-02-18 14:07, Mathias MICHEL via GNU coreutils Bug Reports wrote:Is it expected that --ignore arg does not apply on globbed FILE ?Yes. --ignore is about what 'ls' finds in directories, not about command-line arguments.My goal is to avoid using grep or complex find args:> ~/.ssh :: ls id_ed* | grep -v "\.pub$" > id_ed25519 id_ed25519.local id_ed25519_oriTry this:ls --hide='[^i]*' --hide='i[^d]*' --hide='id[^_]*' --hide='id_[^e]*' --hide='id_e[^d]*' --hide='*.pub'Admittedly ugly, but does the job.
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |