Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
./pkg-search.sh: 2: ./pkg-search.sh: Bad substitution in a shell script -
- X-seq: zsh-users 22689
- From: shirish शिरीष <shirishag75@xxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxx>
- Subject: ./pkg-search.sh: 2: ./pkg-search.sh: Bad substitution in a shell script -
- Date: Tue, 9 May 2017 02:28:15 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=MHCXN81+76Wn8dFIPTv6m5TH7yQOpXqhvzGsMNxQCdM=; b=uzcQr7Nr9XfVUMFTMOw2fMiX3H2bpGfl3It3hOxnsvDfio4FkALzLOP/fntVMoHV91 yeZ1DLbWHrJg9hOO3ToDZWqnDHX2+ZLKUeycdKp1VlmAl9DOOkqb08YTt1RBus2ZnMqe Q3iLdKMrW02qqRMDDlx8JTfgk15kD6WaBf6Oir678Ek9xOazCWitM1t3V3G5+11TuUBS 1dAomsEouZWj1z3Bi0CYExsQcWRSU4yKLLF0P4Z8DV3r4fHY4QgLaIiFRcAgOY6QB7RG cgUajJJkdwxVG5ObLFg6YX4+p+6v7j1rYs6htvxPnU7wNV1o9tO59KtOPV+dIF3WihUO HEww==
- 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
Dear Friends,
Please CC me as I'm not subscribed to the list.
I have the following script -
─[$] cat pkg-search.sh
1 for file in /usr/share/doc/*/changelog.Debian.gz; do
2 package=${file:15}
3 package=${package%%/*}
4 echo -n "$package "
5 date -d "$(zgrep "\\-\\- .* <.*> .*" $file|tail -n 1|awk
'BEGIN { FS=" " } { for (i = 2; i <= NF; i++) { if (i > 2) printf "
"; printf "%s", $i } }')" +%s
6 done | sort -k2,2nr -k1
Trying to run the script under zsh I get the following -
[$] ./pkg-search.sh
./pkg-search.sh: 2: ./pkg-search.sh: Bad substitution
I am running zsh 5.3.1
[$] zsh --version
[2:35:24]
zsh 5.3.1 (x86_64-debian-linux-gnu)
On Debian testing/stretch with the latest updates .
Look forward to know what's wrong in the above script.
--
Regards,
Shirish Agarwal शिरीष अग्रवाल
My quotes in this email licensed under CC 3.0
http://creativecommons.org/licenses/by-nc/3.0/
http://flossexperiences.wordpress.com
EB80 462B 08E1 A0DE A73A 2C2F 9F3D C7A4 E1C4 D2D8
Messages sorted by:
Reverse Date,
Date,
Thread,
Author