From 5acaff9bdce4ccf6c8d6d7f95f08c0f6c7eea9de Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 10 Jun 2020 09:45:46 +0300 Subject: [PATCH] kiss: Use $pid instead of $$ --- kiss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kiss b/kiss index 9d9f236..0406936 100755 --- a/kiss +++ b/kiss @@ -293,7 +293,7 @@ pkg_extract() { # Move the directory to prevent naming conflicts between # the child and parent - mv -f "$dir" "$$-$dir" + mv -f "$dir" "$pid-$dir" # First attempt to move all files up a directory level, # if any files/directories fail (due to mv's lack of @@ -307,17 +307,17 @@ pkg_extract() { # Using only '$@' causes a single file from each # invocation to be left out of the list. Weird, right? { - find "$$-$dir/." ! -name . -prune \ + find "$pid-$dir/." ! -name . -prune \ -exec sh -c 'mv -f "$0" "$@" .' {} + || - find "$$-$dir/." ! -name . -prune \ + find "$pid-$dir/." ! -name . -prune \ -exec sh -c 'cp -fRp "$0" "$@" .' {} + } 2>/dev/null # Remove the directory now that all files have been # transferred out of it. This can't be a simple 'rmdir' # as we may leave files in here due to above. - rm -rf "$$-$dir" + rm -rf "$pid-$dir" done # Clean up after ourselves and remove the temporary tar