Shell script: Create TAR from every sub-directory, de-referencing symlinks
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
done