From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: globbing and quoting in a function
Date: Wed, 20 Jul 2005 07:48:17 +0000 [thread overview]
Message-ID: <1050720074817.ZM7476@candle.brasslantern.com> (raw)
In-Reply-To: =?iso-8859-1?Q?=3Cm0u0iqkq1l=2Efsf=40msc-ge=2Ecom=3E?= =?iso-8859-1?Q?Comments=3A_In_reply_to__Stefan_Reich=F6r_=3Cstefan=40xste?= =?iso-8859-1?Q?ve=2Eat=3E?= =?iso-8859-1?Q?________=22Re=3A_globbing_and_quoting_in_a_function=22_=28?= =?iso-8859-1?Q?Jul_20=2C__7=3A24am=29?=
This business with gmane double-posting to both zsh-users and zsh-workers
is getting annoying. As gmane is apparently not clever enough to get this
right by themselves, would you gmane users please be polite and trim off
one of the two newsgroups when posting? (I don't know what names gmane
gives to their groups that are gatewayed to the zsh lists.)
On Jul 20, 7:24am, Stefan Reichör wrote:
}
} I'd like to call:
} lsnew *
} lsnew a*
}
} Is there an easy way to do it in zsh?
Yes. It's been answered in the previous postings.
function lsnew { ls -tr -dl $~1(om[1,30]) }
alias lsnew='noglob lsnew'
Once the alias has been defined, you must not attempt to re-define the
lsnew function unless you do so using the "function" keyword as above.
The existence of the alias causes the
lsnew() { ... }
syntax to do something different from what you would expect.
A drawback to the above is that you cannot do
lsnew *(.)
because that expands to
ls -tr -dl *(.)(om[1,30])
and two sets of glob qualifiers don't mix.
next prev parent reply other threads:[~2005-07-20 7:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-19 14:27 Stefan Reichör
2005-07-19 14:59 ` Doug Kearns
2005-07-19 15:29 ` Wayne Davison
2005-07-20 3:54 ` Bart Schaefer
2005-07-20 5:24 ` Stefan Reichör
2005-07-20 7:48 ` Bart Schaefer [this message]
2005-07-20 8:29 ` Stefan Reichör
2005-07-19 15:35 ` Stefan Reichör
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=1050720074817.ZM7476@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/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).