Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Regression in zsh 5.7: locking failed for /dev/null: permission denied
- X-seq: zsh-workers 44022
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Regression in zsh 5.7: locking failed for /dev/null: permission denied
- Date: Tue, 29 Jan 2019 19:51:24 +0100
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I use the following function, see suggestion from
http://www.zsh.org/mla/workers/2016/msg02070.html
append_file_to_hist()
{
emulate -LR zsh
local -a entries
# Implementation issue: read -r ignores backslash-newline
# folding, but without -r embedded backslashes are stripped,
# which seems a bigger problem. Fix up $entries later.
IFS=$'\n' read -r -d '' -A entries <$1
(( $#entries )) || return
# Must supply a file name here to set HISTSIZE and SAVEHIST
fc -pa /dev/null $#entries $(( SAVEHIST + $#entries ))
while (( $#entries ))
do
if [[ "$entries[1]" == *\\ ]] then
entries[1,2]=( ${entries[1]%\\}$'\n'${entries[2]} )
else
print -r -S $entries[1]
shift 1 entries
fi
done
fc -A ${2:-$HISTFILE}
# Reset SAVEHIST to avoid attempting to lock /dev/null
SAVEHIST=0 # fc -p makes this implicitly local
}
When I use it, I get the error:
append_file_to_hist:24: locking failed for /dev/null: permission denied
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author