escape file/ folder names

This commit is contained in:
fabian 2025-04-16 21:39:25 +02:00
parent 620857fc8a
commit 6b07a1175f
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
source=$1
destinationPart=${1%/}; # cut off trailing "/"
# tar cfv $destinationPart.tar $source && xz $destinationPart.tar;
tar c -I"xz -v" -vf $destinationPart.tar.xz $source
# tar cfv "$destinationPart.tar" "$source" && xz "$destinationPart.tar";
tar c -I"xz -v" -vf "$destinationPart.tar.xz" "$source"

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
source=$1;
# archive=${source%.xz}; # cut off trailing ".xz"
# unxz $source && tar xfv $archive
tar x -I"unxz -v" -vf $source
# unxz "$source" && tar xfv "$archive"
tar x -I"unxz -v" -vf "$source"