Created
November 22, 2019 15:45
-
-
Save isaaclw/acf345d31e09b9cbf0a55835525a472d to your computer and use it in GitHub Desktop.
Copy and unlink files #bash #fs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in "$@"; do | |
temp="$(mktemp -d ./hardlnk-XXXXXXXX)" | |
[ -e "$temp" ] && cp -ip "$i" "$temp/tempcopy" && mv "$temp/tempcopy" "$i" && rmdir "$temp" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment