tarback/tests/common.sh

13 lines
469 B
Bash
Executable file

#!/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 '/')"
echo "$workdir"
}