Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Use of variables in the <x-y> globbing mechanism
- X-seq: zsh-users 21466
- From: Henman <dhenman@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Use of variables in the <x-y> globbing mechanism
- Date: Wed, 20 Apr 2016 22:24:58 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=Hu6P/I4y6HHLOhP1hB4kvtqJ1lcIor0hgYaSCuKgANA=; b=MSWJ2Lm7lLTm2/mS17aMq0iro+sDSGP5ZeHICxKrqPZf97N4L2zZORpBgqorGsJg05 KQ/Rplre4IDSYYYVsSb+0q/sIeuB5JpZPgsJuCJeuVRGC/hz6v/xTnUBflwKtKpi1DQ+ WaGzcSEe8e5qANcF2dOZIL8u6acSpssl570HtYUDGL9960fSh5cBxGh+/uunZAJ39hJf LolIkD82H8qK+kKUQwZ8MzNYU8I4rcDK9dihyn98fuUk94viS8bWeDgWjjfuvH9TsV0t rrcOErdNjEgOXsHCHvH+VpC24eB191xhTiMf8RTuBWS2zaOHUmUY4lx+97oHZJexs1iT i/rw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
It would be very useful if the <x-y> globbing mechanism would work with
variables. I can't get it to work. If it only accepts numeric
constants, nothing can be done, but it would be an elegant solution to
my problem of taking a slice of files out of a larger group for
processing in a batch file.
I am trying to do this: ( Where the Src FName Patter SFNPAT gives the
fname prefix and fname extension and the <01-15> specifies which slice
of files to get.
# The from_number and to_number are read in from a list of files to process
and injected between a filename pattern's prefix and extension.
for file in ${SFNPAT:r}-<${from_number}-${to_number}>.${SFNPAT:e}
do
# processing goes here
done
When I try the above script, I am greeted with a " parse error near
`<'" error message. This can be done otherways, I just wanted to
know if the <X-Y> form could be used in some way to acheive this.
Thanks
Messages sorted by:
Reverse Date,
Date,
Thread,
Author