Shell-Skript: TAR aus jedem Unterverzeichnis erstellen, Symlinks dereferenzieren
tar_each_directory.sh
for i in ../mydir/*; do
if [ -L "$i" ]; then
# Dereference the symlink
tar cvhf "$(basename "$i").tar" "$i"
else
# Regular tar without dereferencing
tar cvf "$(basename "$i").tar" "$i"
fi
doneCheck out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow