9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: John Kodis <kodis@tux.gsfc.nasa.gov>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Ugly hack
Date: Mon, 17 Feb 2003 09:53:36 +0000	[thread overview]
Message-ID: <slrnb4t73f.han.kodis@tux.gsfc.nasa.gov> (raw)
In-Reply-To: <20030215174605.I9084@cackle.proxima.alt.za>

In article <20030215174605.I9084@cackle.proxima.alt.za>, Lucio De Re wrote:

>  I've found the ability to limit shell command line argument expansion
>  (only in English can one write something so succintly and so ugly) to
>  directories rather than all directory entries by suffixing the last
>  part with a "/".  This is normal behaviour in the NetBSD shells.

You could say this in an even uglier and more succinct fashion by
writing "globbing" instead of "shell command line argument expansion".

>  broken! echo rdesk*
>  rdesktop-1.1.0 rdesktop-1.1.0.tar
>  broken! cd rdesk*/
>  broken! pwd
>  /usr/lucio/Projects/Sundry/rdesktop-1.1.0

While I recognize that this would be a generally useful mechanism, in
this particular case, I'd just use filename completion: I'd type "cd
rdesk<TAB>", this gets completed to rdesktop-1.1.0, I hit return and
I'm done.

If you're interested in prior art in this area, you may want to look
over the man page for zsh glob qualifiers at
http://zsh.sourceforge.net/Doc/Release/zsh_13.html#SEC62

In zsh, *(/) expands to all directories, *(*) expands to a executable
plain files, *(W,X) expands to all world-writable or world-executable
files, and the complexity spirals rapidly out of control from there.

--
John Kodis                                    Goddard Space Flight Center
kodis@mail630.gsfc.nasa.gov                      Greenbelt, Maryland, USA


      parent reply	other threads:[~2003-02-17  9:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-15 15:46 Lucio De Re
2003-02-15 16:18 ` Sam
2003-02-15 16:21   ` Dan Cross
2003-02-15 16:29   ` Lucio De Re
2003-02-15 23:56 ` Geoff Collyer
2003-02-16  9:20   ` Lucio De Re
2003-02-16  9:25     ` Lucio De Re
2003-02-16 12:18       ` Lucio De Re
2003-02-16 12:45         ` Lucio De Re
2003-02-16 14:19 ` Russ Cox
2003-02-16 15:00   ` Lucio De Re
2003-02-16 15:31     ` David Butler
2003-02-16 15:40     ` Russ Cox
2003-02-17  5:27       ` Lucio De Re
2003-02-17  9:53 ` John Kodis [this message]

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=slrnb4t73f.han.kodis@tux.gsfc.nasa.gov \
    --to=kodis@tux.gsfc.nasa.gov \
    --cc=9fans@cse.psu.edu \
    /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.
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).