Skip to content

Commit

Permalink
Use awk to enclose filename in single quotes tar #99
Browse files Browse the repository at this point in the history
  • Loading branch information
awalsh128 committed Apr 14, 2023
1 parent 1850ee5 commit abb3a6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion install_and_cache_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ for installed_package in ${installed_packages}; do
& get_install_script_filepath "" "${package_name}" "preinst" \
& get_install_script_filepath "" "${package_name}" "postinst"; } |
while IFS= read -r f; do test -f "${f}" -o -L "${f}" && get_tar_relpath "${f}"; done |
xargs -I {} echo \'{}\' | # Single quotes ensure literals like backslash get captured.
awk '{print "\x27"$1"\x27"}' | # Single quotes ensure literals like backslash get captured.
sudo xargs tar -cf "${cache_filepath}" -C /

log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))."
Expand Down

0 comments on commit abb3a6d

Please sign in to comment.