tarback/tests/common.sh

14 lines
469 B
Bash
Raw Normal View History

2023-06-07 13:21:53 +02:00
#!/bin/sh
create_directories() {
workdir="$(mktemp -d)"
mkdir -p "$workdir/source"
mkdir -p "$workdir/dest"
mkdir -p "$workdir/restore"
# generate a filename with every possible byte in it to test
# escaping, the only character not included is `/` since that is
# illegal for filenames (obviously)
echo 'Hello World!' > "$workdir/source/$(for i in $(seq 0 255); do printf '%x' "$i" | xxd -r -p; done | tr -d '/')"
2023-06-07 13:21:53 +02:00
echo "$workdir"
}