Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Creating a Case statement dynamically
- X-seq: zsh-users 8998
- From: John Reese <john.reese@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Creating a Case statement dynamically
- Date: Tue, 28 Jun 2005 15:50:54 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qc0gqdGJE3hElkZ1yeUcVO0dsJQcKuml2bmSKlDp7tKsYzOBd2nTeaVZI4K5YTjYd5xlcxX0OHe2PbBAQOupgmaiq6N+fPhTknDryBWaZV6Sy0JzxdZW0w2JvX6dpG0lVpSQ0KhUmRgkcRSlm9awhX1OXJzgG1Z+MeLmEWcuyiA=
- In-reply-to: <20050628175845.GA5050@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <kf13c1pi5cjc93homkhm5dpgkt62lhs7n7@xxxxxxx> <20050628175845.GA5050@xxxxxxxxxxxxxxxx>
- Reply-to: John Reese <john.reese@xxxxxxxxx>
2005/6/28, Nikolai Weibull <mailing-lists.zsh-users@xxxxxxxxxxxxxxxxxxxxxx>:
> zzapper wrote:
>
> > I have script which lists a series of files I might wish to edit
> >
> > I'd like the script to dynamically output a case
>
> Use an array/list and select the nth element from it,
> nikolai
>
I suggest the "select" loop. For example:
select f in **/*.tex; do
if [[ "$REPLY" = q ]]; then
break
elif [[ -n "$f" ]]; then
gvim $f
fi
done
Note that this block will loop until you exit with ^C or q.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author