Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Repeatable (@M) bug
- X-seq: zsh-workers 36166
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Repeatable (@M) bug
- Date: Fri, 14 Aug 2015 10:53:35 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=3iPe3J3mrkryM+ux3swBAZsNQija/sUJv/QJfrd27vQ=; b=eJSiMwzfUOu2qRUjyIKFVwZMwXozYAGbzNTYd5+ppqW19I9uk6iiWweKvUjny/MC7N gGqECYQfoeXq5h4BYRhwssv+yHiWWCaPSoFgVXPHrt5KzhDQCH0qS4/PfcY9VivqzqDA N+ZCpTTMU9ygQWgqj+P7CoUkf3J1exUUu6ZlSsEGzIUgsNTsfv/CqNeP6/xCq7uQ5z5w 0UUGlzVEgFaia04QkU0IZFj1gm1fGpgTXmnJPTyvLdatssc2APvCUobYE/sxr4p7BKxJ IkDDG1P7qYXjriyLinewOMk94L7LrZGzp5CucGXddEdQ2DIjNYZ5RExj0BnDc2xWuhM1 9flQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello
Summary description: searching for "xyza" doesn't match "xyza", only "xyzab"
Illustration by code:
---------
list=( "aisj" )
echo "1 |${(@M)list:#*aisj*}"
list=( "aisj" "aisja" )
echo "2 |${(@M)list:#*aisja*}"
echo "3 |${(@M)list:#*aisj*}"
list=( "aisj" "aisja" "aisjas" )
echo "4 |${(@M)list:#*aisjas*}"
echo "5 |${(@M)list:#*aisja*}"
echo "6 |${(@M)list:#*aisj*}"
---------
This example works. "aisj" returns "aisj", "aisja" returns "aisja", "aisj"
returns "aisja" AND "aisj", etc. However in a script the same steps yield
the erroneous behavior: "aisj" matches only "aisja" and "aisjas", and
"aisja" matches only "aisjas".
The script is:
https://github.com/psprint/zsh-visual-tools/
It is really simple. It allows to grep for a pattern when displaying
history. Calling the script extends history content - like the 'list=(
"aisj" "aisja" )' lines. Equivalent of the code already mentioned is:
v-list aisj
No matching history entries
v-list aisja
No matching history entries
v-list aisj
(matches only aisja)
v-history aisjas
No matching history entries
v-history aisja
(matches only aisjas)
v-history aisj
(matches only aisja and aisjas)
Also, when I wrote a script to repeat v-history calls automatically (no
through command line) it resulted in:
v-history:fc:21: no such event: 1000
This is a very interesting result, as the `history -rn 1000` call just must
work.
I checked this on OSX 5.0.2 and hombrew's 5.0.8-dev-1.
PS. What I mean by the last mentioned script is:
#!/bin/zsh
autoload v-history
v-history aisj
v-history aisja
v-history aisj
v-history aisjas
v-history aisja
v-history aisj
Best Regards,
Sebastian
Messages sorted by:
Reverse Date,
Date,
Thread,
Author