1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-04 08:41:31 +01:00

zsh: functions: avoid using aliases when calling rm/mv

This commit is contained in:
bretello 2023-07-08 10:18:04 +02:00
parent f30468da11
commit e08ee08768
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -95,10 +95,10 @@ _z() {
' 2>/dev/null >| "$tempfile" ' 2>/dev/null >| "$tempfile"
# do our best to avoid clobbering the datafile in a race condition. # do our best to avoid clobbering the datafile in a race condition.
if [ $? -ne 0 -a -f "$datafile" ]; then if [ $? -ne 0 -a -f "$datafile" ]; then
env rm -f "$tempfile" command rm -f "$tempfile"
else else
[ "$_Z_OWNER" ] && chown $_Z_OWNER:"$(id -ng $_Z_OWNER)" "$tempfile" [ "$_Z_OWNER" ] && command chown $_Z_OWNER:"$(id -ng $_Z_OWNER)" "$tempfile"
env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile" command mv -f "$tempfile" "$datafile" || command rm -f "$tempfile"
fi fi
# tab completion # tab completion