Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
globbing in scripts
- X-seq: zsh-users 12263
- From: "Imre Voros" <voros.imre@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: globbing in scripts
- Date: Fri, 30 Nov 2007 02:44:56 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=Y+PKydTrP8qAOZa9psOh4n52u7rxrDmd86/cUJQfUp0=; b=R/qT5xgdwXI0QC1KJHVZIiUjR1sqvWdum2e99HjfrCXRo3fnNUwsygAGdnr5QsFXkuftUFe9uG0FVpvNhhcP21Nga0aNbF8dvwrIpu+NeDpa9gdG5JvKzrrmJhdLuLWEsqe2xAGj+ZcZ4NVVSF4Lekxb5djSzaxCrX1beibQ/GU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=received:message-id:date:from:to:subject:mime-version:content-type; b=npevgcp7ikQuRW9MiqRIdlv/YmIGXn/0dTG1sldk7f1Jo4PoFIopyzp7++k2TIbUx8xT8nnpRwMXRsqBIwhwNCYreEw1VIq9EZ8WriCJz+7Oj2lX71ngDtthQlf5GrCbHF4MPy2HGr02iTGoB5eZaO6cBpvJT8JrAekpkmQAshQ=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I would like to expand complicated filename patterns in scripts. Like if the script (say s) is
#!/bin/zsh
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,
Imre
PS: Sorry if I am sending this twice.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author