Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Split on unquoted space
- X-seq: zsh-users 23684
- From: Jesper Nygårds <jesper.nygards@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Split on unquoted space
- Date: Fri, 28 Sep 2018 09:22:10 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8bOepJA9wNVQhdz7gl1omTlOjailp3jnfPDSuliU1Jk=; b=Q9EqYA2kla4IDnEK58iTqrtqUxDLtvjZRotDFzMEy16RxtfihffYproLbCUbhmDXEw VBqSp5e8tW9omIX7Gg4ZXfi7abZauuLRb+1DN9ao5POxAuV4uPeUB3dZDQLsYD4Bxbl9 8Nkve4+aMOMVWycgYK7sAMCBmJhrw7yAe5K+JXr8Hk0nzA9F4O7XGEv3MZfSR1rnR9F4 T9RyZQUX9EhoPUEPOQXYplChLnjV16GrirdDzfSsSJ6UTOI0DZ5/K0eJyfWCKVixzWQQ +5PCP5RxG31QkcETGVqykDLpdPYaGGddBwyuCEw5ek+k6uzVrzNjcU+M2P+p7IV4js2N edag==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
This might well be a case of me not understanding my problem, but is there
a way to use parameter expansion to split only on unquoted spaces?
If I have myvar="my\ string", ${=myvar} results in "my\" and "var", i.e.
zsh doesn't care about the fact that the space is quoted.
On the other hand, myvar="my\ var", ${(z)myvar} does respect the quoted
space and makes no split, but then myvar="my|var", ${(z)myvar} results in
"my" "|" "var", which is not what I want in this case.
So in short, is there a way to only split on space, but not split on a
quoted space?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author