Exclusions of TAR, do the type of quotes matter here?
By the question Exclusions of TAR, do the type of quotes matter here?, I mean - and this boggles my mind for a long time - the below example = single quotes vs double quotes.
• -exclude="/proc/*"
• -exclude='/proc/*'
I am unsure if these two have the very same effect or there are some differences in behavior. I suppose normally these differ as "..." would be prone to shell expansion, but I am unable to verify this claim. On the contrary, it also could be processed internally by TAR?,... But I did not find any relevant info online sadly. Maybe I am asking wrong questions... Anyway my intention: Create the above proc directory completely EMPTY.
My OS:
lsb_release -d
Description: Debian GNU/Linux 13 (trixie)
My TAR version:
tar --version | head -1
tar (GNU tar) 1.35
I don't care for other systems or TAR versions, yet others could be, so if you decide to include extra info, all the more reason to accept such an answer. No hurry. Oh, and please include some source for your info, if possible. Thanks.
Example code:
#!/bin/bash
set -e
tar --one-file-system -cpzf /pico_server_backup_$(date +%F).tar.gz \
- -exclude="/pico_server_backup_*.tar.gz" \
- -exclude="/proc/*" \
- -exclude="/sys/*" \
- -exclude="/dev/*" \
- -exclude="/run/*" \
- -exclude="/tmp/*" \
- -exclude="/mnt/*" \
- -exclude="/media/*" \
- -exclude="/lost+found" \
- -exclude="/swapfile" \
/
Let me just add, this is no code review, so please refrain from commenting upon the example code itself, e.g. that old versions of TAR behaved different, or the fact I use --one-file-system so TAR won't descend into proc, sys, etc anyway.
Focus on the quotes, thanks!