Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

print -s and History Expansion



Multiword lines issued to history with print -s don't appear to be
considered as multiple words, as evidenced by the unexpected history
expansion found in the following interaction:

[cjohnson@sissy] ~ S1: echo a b c
a b c
[cjohnson@sissy] ~ S1: echo !!:1
echo a
a
[cjohnson@sissy] ~ S1:  print -s 'echo a b c'
[cjohnson@sissy] ~ S1: echo !!:1
zsh: no such word in event
[cjohnson@sissy] ~ S1:  print -s 'echo a b c'
[cjohnson@sissy] ~ S1: echo !!
echo echo a b c
echo a b c
[cjohnson@sissy] ~ S1:  print -s 'echo a b c'
[cjohnson@sissy] ~ S1: echo !!:0
echo echo a b c
echo a b c

The whole line is considered !!:0 and not just the command name.  I'm
not running the latest version of zsh, so I don't know if this is
changed in a newer version.  Perhaps it's a feature that I don't
understand.  Can any verify that this is or isn't supposed to happen?

Thanks!

-- 
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson



Messages sorted by: Reverse Date, Date, Thread, Author