zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: named directory expansion on strings
Date: Sun, 14 Mar 2004 18:54:37 +0000	[thread overview]
Message-ID: <1040314185437.ZM6792@candle.brasslantern.com> (raw)
In-Reply-To: <eern2388dxq8.dlg@thorstenkampe.de>

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.


  reply	other threads:[~2004-03-14 18:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-13  3:29 Thorsten Kampe
2004-03-13  6:41 ` Bart Schaefer
2004-03-13 17:48   ` Thorsten Kampe
2004-03-14 18:54     ` Bart Schaefer [this message]
2004-03-14 21:24       ` Thorsten Kampe
2004-03-14 21:57       ` Python/zsh/perl [was: named directory expansion on strings] Vincent Stemen
2004-03-15  4:00         ` Jos Backus
2004-03-15  7:04         ` [OT]Python/zsh/perl " Bob Schmertz
2004-03-15 23:37           ` [OT]Python/zsh/perl Vincent Stemen
2004-03-17  4:03           ` [OT]Python/zsh/perl [was: named directory expansion on strings] Eric Mangold
2004-03-14 22:19       ` named directory expansion on strings Thorsten Kampe
2004-03-14 23:19         ` Bart Schaefer

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=1040314185437.ZM6792@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).