zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: (N) defaults to whole directory listing
Date: Fri, 29 Jan 2021 11:52:34 -0800	[thread overview]
Message-ID: <7c9ba2d1-d1ab-fe0f-7ce0-2141e5ab04fe@eastlink.ca> (raw)
In-Reply-To: <7ED923BE-3073-40F6-956A-B81FABC6F2B2@larryv.me>

On 2021-01-29 9:52 a.m., Lawrence Velázquez wrote:
> mkdir -p foo/bar{1,2} && touch foo/bar{1,2}/baz && cd foo
Ah, right, I need 'ls -d *' to mirror plain 'ls'.  Anyway the point 
remains that ls has no way of knowing that zsh has removed the argument 
thus there is no failure to report.

     Have you considered using "setopt CSH_NULL_GLOB" and then not using (N) ...?

To avoid surprises it seems the ' 2> dev/null ' is going to satisfy.  In unnecessary detail what was happening was that in my wrapper I'd get this:

     1 /aWorking/Zsh/Source/Wk 3 $ l zzz

     LISTING of "zzz": all file types, INsensitive. Sorting upside down by: Mod. Time:

     drwxr-xr-x 10 20480 [2021-01-29--07:08] ./

     Items found: 1
     Total bytes in this directory: 2.8M
     Total including subdirs: 12M	

... there was always that annoying false find of 'dot'.  But  ' >2 /dev/null ' fixes it.  BTW the 'Items found' comes from using 'wc' but that too reports one item even if the output is zero which seems strange but it's fixable:

     1 /aWorking/Zsh/Source/Wk 3 $ . l; l zzz

     LISTING of "zzz": all file types, INsensitive. Sorting upside down by: Mod. Time:

     Nothing found

... so all's well.





  reply	other threads:[~2021-01-29 19:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 15:24 Ray Andrews
2021-01-29 15:33 ` Roman Perepelitsa
2021-01-29 17:01   ` Ray Andrews
2021-01-29 17:52     ` Lawrence Velázquez
2021-01-29 19:52       ` Ray Andrews [this message]
2021-01-29 18:47     ` Bart Schaefer
2021-01-29 19:04   ` Bart Schaefer
2021-01-30 10:50     ` Roman Perepelitsa
2021-01-30 15:00       ` Beverly Pope
2021-06-18 10:24     ` Why does >&- produce an error message when connected to a builtin? (was Re: (N) defaults to whole directory listing) Marlon Richert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c9ba2d1-d1ab-fe0f-7ce0-2141e5ab04fe@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).