Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: named directory expansion on strings
- X-seq: zsh-users 7174
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: named directory expansion on strings
- Date: Sun, 14 Mar 2004 18:54:37 +0000
- In-reply-to: <eern2388dxq8.dlg@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <v5mfocam7x43.dlg@xxxxxxxxxxxxxxxx> <1040313064100.ZM28748@xxxxxxxxxxxxxxxxxxxxxxx> <eern2388dxq8.dlg@xxxxxxxxxxxxxxxx>
On Mar 13, 6:48pm, Thorsten Kampe wrote:
:
: Fortunately, I found a better way[1]. Any style comments on my first
: /really complicated/ ;-) zsh shell script welcome!
Nothing major ...
: | for file in /etc/profile.d/zshell.zsh \
: | /etc/zsh/zprofile \
: | /etc/zprofile \
: | ~/.zsh/.zlogin \
: | ~/.zsh/.zshrc \
: | ~/.zshenv
: | do
...
: | done
If you want to list every name on its own line like that, you might try
the parenthesized list syntax:
for file (
/etc/profile.d/zshell.zsh
/etc/zsh/zprofile
/etc/zprofile
~/.zsh/.zlogin
~/.zsh/.zshrc
~/.zshenv
)
do
...
done
Not compatible with non-zsh shells, of course. Also works with the
word "foreach", in which case you may omit the "do" and replace "done"
with "end" (syntax stolen from csh).
: | print ${(r.$JUSTIFY.):-"${ltred}! ${white}..."
You don't need $JUSTIFY there: (r.JUSTIFY.) is sufficient, because the
expression is interpreted in math context where all non-keywords are
variable references.
: Long live the Zen of Python[2].
Hrm. As far as I'm concerned, the Python folks went wrong when they gave
semantic significance to depth of whitespace indentation, and all of the
right decisions they've made since have been a waste of effort.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author