zsh-users
 help / color / mirror / code / Atom feed
From: Henman <dhenman@gmail.com>
To: zsh-users@zsh.org
Subject: Use of variables in the <x-y> globbing mechanism
Date: Wed, 20 Apr 2016 22:24:58 -0700	[thread overview]
Message-ID: <5718642A.90505@gmail.com> (raw)


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


             reply	other threads:[~2016-04-21  5:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21  5:24 Henman [this message]
2016-04-21  7:15 ` Bart Schaefer
2016-04-22 11:05   ` Nikolay Aleksandrovich Pavlov (ZyX)

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=5718642A.90505@gmail.com \
    --to=dhenman@gmail.com \
    --cc=zsh-users@zsh.org \
    /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).