zsh-workers
 help / color / mirror / code / Atom feed
* Possible :q quoting bug
@ 2019-08-08 16:06 Aryn Starr
  2019-08-08 21:37 ` Bart Schaefer
  2019-08-08 21:48 ` Stephane Chazelas
  0 siblings, 2 replies; 4+ messages in thread
From: Aryn Starr @ 2019-08-08 16:06 UTC (permalink / raw)
  To: zsh-workers

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
}
```

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-09 11:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 16:06 Possible :q quoting bug Aryn Starr
2019-08-08 21:37 ` Bart Schaefer
2019-08-08 21:48 ` Stephane Chazelas
2019-08-09 11:00   ` Aryn Starr

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).