Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Possible :q quoting bug
- X-seq: zsh-workers 44641
- From: Aryn Starr <whereislelouch@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Possible :q quoting bug
- Date: Thu, 8 Aug 2019 20:36:00 +0430
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1565280365; bh=kjG/jNhrfFdpwFw97o3GzF3NBfGmGVf07gHUDpynIzo=; h=From:Content-Type:Subject:Message-Id:Date:To; b=0iYBiq+gP0bXEPCvrZOhN6XsfLJ1jD2ZrjMYNDmELp9pA2proKi4w3O6w32X4E1ZB jiaS62ZqBAOCnHD/5jaugx2dRkXG1AQMp4zdGcuDvgfijJQYsntSWNdNl8BQ6CC5qg 0/ycOgsORnQRVea7vfm7ZrX7NQDtAp+EClvOfCdqt9aEMXgi5Jq64TyxkLO2NgMYF4 4oUzmSOuY9crIz4S01gZFb6azEr+hlpsXb96BVIimQWpzcQonDKl2LdktZc63PKvkz cEo7hDYhIXRUMsrIouFBW0gx48PXsocLKLLNKLBS/qtsJEa62A+yKnZtMIqthHrYtf GOYfU77i6jpeQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hi,
I expect this function to be idempotent on the command line:
```
Function reveal() {
eval “${@:q}”
}
```
But it’s not. It loses empty args.
I have written the following function to fix this ‘bug’:
```
gquote () {
local i
for i in "$@"
do
test -z "$i" && print -rn "''" " " || print -rn -- "${i:q}" " "
done
}
```
Messages sorted by:
Reverse Date,
Date,
Thread,
Author