Use 'mktemp -t', leave tempfile cleanup to the OS
This commit is contained in:
@@ -29,8 +29,7 @@ function alias_completion {
|
||||
(( ${#completions[@]} == 0 )) && return 0
|
||||
|
||||
# create temporary file for wrapper functions and completions
|
||||
rm -f "/tmp/${namespace}-*.tmp" # preliminary cleanup
|
||||
local tmp_file; tmp_file="$(mktemp "/tmp/${namespace}-${RANDOM}XXX.tmp")" || return 1
|
||||
local tmp_file; tmp_file="$(mktemp -t "${namespace}-${RANDOM}XXX.tmp")" || return 1
|
||||
|
||||
local completion_loader; completion_loader="$(complete -p -D 2>/dev/null | sed -Ene 's/.* -F ([^ ]*).*/\1/p')"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user