Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Trying to reverse a word.
- X-seq: zsh-users 12056
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: "Zsh users list" <zsh-users@xxxxxxxxxx>
- Subject: Trying to reverse a word.
- Date: Sat, 20 Oct 2007 00:01:26 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=NUlnBV1afv6nW1B9jcQDkOi3iD5BKhnoKh+SXVLP6oU=; b=KoGb6ZmXEqq91PG++Jvew8+jq3CQorP09pRnpdjUk3r2ItcKvetN6z1R60fKqNVGCIVbcsC+cJ7koqCQQqifYHzD/eedUkxOPAM1ZjN5wowZd99s6qnZTpORqBm9brYqofLvazLY5MD3+11F2e0rkjliolk48KgAASHxzD/AOIw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=caT36lHTZY5EfEkYB64Oa1ad3Ege3+4fQ31lKITNamIb23er5JcE51ZQ01t1JmSIFe+F41TwtwRj3+dFVN0ECOn3+Bi2IPXZyamLrm/u2k8vzzKIGRbDfMxMUk+Slsqzh3b4/tH2Xo5R9keon6zEjSK1Kdf0ywOXjTOgeFfU/MM=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I found modify-current-argument a while ago so now I'm making some
silly keybinds for fun and profit. One idea was a bind to reverse a
word, but I'm hitting a confusing issue. Here's what I'm trying:
% echo ${(j::)${(Oa)${(s::):-hello}}}
olleh
Which appears to work fine, BUT, when you give that to
modify-current-argument you just get "h e l l o", and I found it
encloses the string in double quotes:
% echo "${(j::)${(Oa)${(s::):-hello}}}"
h e l l o
What the heck is going on here?
If I remove the Oa part, it goes back to being a single word:
% echo "${(j::)${(s::):-hello}}"
hello
With some other flag there's the same issue:
echo "${(j::)${(U)${(s::):-hello}}}"
H E L L O
the only thing I can come up with that works in double quotes is a
$(), but it seems fragile.
% echo "$(echo ${(j::)${(Oa)${(s::):-hello}}})"
olleh
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author