Zsh Mailing List Archive
Messages sorted by:
Re: globbing in scripts
- X-seq: zsh-users 12264
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: globbing in scripts
- Date: Fri, 30 Nov 2007 04:25:54 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=n7K0EuHnqICbVfC55rX41wDaEsGVHesbyZwM74a2AVE=; b=OYeXDWvpSs1zWwOimjRn4bH7KX157m1pGDih31fUwN7H1jz2rbAY/XGzWSCxE1Z0ZiD+Pb5yThXLvxdrdxUmEYKQ2YuZbD2Y61YXnS1ss1ioJy+fAAzirOua62dQ+VVUZ21VWs0KSBPxUxZ8vvjm60Frd1VZVkSNUcM03Xsj/LY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BHsXorNaR0s4vRcjx8B9/aI1r/3Vl8uAHAxtW2wiI4mfYDQX+/hJV0xY4jfzay782124liLGK4jDCp4iZ7wUN3fKeLZ1HF8tWfchFOXDIi+3XHVlMo9s/mQPzC/eNaKJn19Ea76O3EBrli3TRBnQUR71sg/Hek5k1rYi6X+zJP4=
- In-reply-to: <5d3c901b0711291844o613e432dq56b76aa718b53152@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <5d3c901b0711291844o613e432dq56b76aa718b53152@xxxxxxxxxxxxxx>
On 30/11/2007, Imre Voros <voros.imre@xxxxxxxxxxxxxx> wrote:
> I would like to expand complicated filename patterns in scripts. Like if
> the script (say s) is
> ls $~1
> with the call
> ./s "^f*"
> it should do the same as
> ls ^f*
> This works fine with simpler patterns like
> ./s "*"
> but as soon as anything more complicated appears it keeps handling $~1 as a
> string. Strangely enough outside scripts it works fine again:
> p="^f*"; ls $~p
> does exactly what one would expect.
> Am I being thick? How can I do it? I would be happy with either different
> calling of the script or (and?) different script, but with passing the
> pattern as a single argument.
> Many thanks,
> PS: Sorry if I am sending this twice.
Maybe you need to setopt extendedglob in the script?
Messages sorted by: