Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
$history[@] doesn't contain last element from $HISTFILE
- X-seq: zsh-workers 39639
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: $history[@] doesn't contain last element from $HISTFILE
- Date: Fri, 14 Oct 2016 18:32:04 +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; bh=XkEipFZQMYQFySfcr/zi4bkl2RNpXcjqidLOpEZArA0=; b=hW2bCqT63gkRf2TSumjOo62pUFf3BjlWP9VFA6lSdJ0VfMC55EPbN1yh1hm9gkzPlu GRd27SMOpnQmgPz/sDushrjvb1KviryaYnr+L/gxL9pKHXn392mDvjC8VRnJKZp+9UEs CrayNsvFCd0L17wqUYMuPqkDOT22ji2j0ZdIjUylTxWwOESiAm/j6ttKjdahKo8hb3PX KGmkG1z+EAhye2jeny7qMUhJupoii6nnEz4dbefLYnSLj50b9GvHyokr99zL/h5IhU7w GxdaLR50RUNh86mLDXvkgah3jVKlEwlJOIpHjwx3LhVIS2GoRac6mXuU+bcvNxjCHb4x 7XBw==
- 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
typeset -a list
() {
echo "a" >! phist2.db
echo "b" >>! phist2.db
fc -Rap "phist2.db"
list=( ${history[@]} )
echo "${history[2]}"
echo "${history[1]}"
echo "${#history}";
integer size="${#history}"
size+=1
echo "$size" / "${history[$size]}"
}
print -rl "Now:" "${list[@]}"
b
a
1
2 / b
Now:
a
The output should be:
b
a
My workaround is:
list=( "${history[$size]}" ${history[@]} )
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author