Skip to content

Commit

Permalink
Correctly quote paths and glob
Browse files Browse the repository at this point in the history
- Per SC2086
“When quoting composite arguments, make sure to exclude globs and brace expansions, which lose their special meaning in double quotes: "$HOME/$dir/src/*.c" will not expand, but "$HOME/$dir/src"/*.c will.”
  • Loading branch information
0xmachos committed May 11, 2024
1 parent d1140e6 commit 0606bba
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions uuid
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ setopt null_glob

function main {

declare -a UUID_PATHS=($HOME/Library/Application\ Support/CrashReporter/* \
$HOME/Library/Dictionaries/CoreDataUbiquitySupport/* \
$HOME/Library/Containers/*/Data/Library/Application\ Support/CrashReporter/*)
declare -a UUID_PATHS=("${HOME}/Library/Application Support/CrashReporter/" \
"${HOME}/Library/Dictionaries/CoreDataUbiquitySupport/" \
"${HOME}/Library/Containers/*/Data/Library/Application Support/CrashReporter/")
# $HOME/Library/Keychains/$UUID/
# Inside $HOME/Library/Keychains/ there will be a directory named after the UUID of the system
declare -a UUID_FILES=($HOME/Pictures/Photos\ Library.photoslibrary/database/Photos.sqlite.lock)
# $HOME/Library/Preferences/ByHost/com.apple.loginwindow.UUID.plist

declare -a UUID_FILES=("$HOME/Pictures/Photos Library.photoslibrary/database/Photos.sqlite.lock")

echo "Paths which potentially contain UUID:"
for UUID_PATH in "${UUID_PATHS[@]}"; do
echo "${UUID_PATH}"
echo "${UUID_PATH}"*
done

echo
Expand Down

0 comments on commit 0606bba

Please sign in to comment.