Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Creating a Case statement dynamically



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