Skip to content

Instantly share code, notes, and snippets.

@SheetJSDev
Created August 15, 2021 19:36
Embed
What would you like to do?
#!/bin/bash
OUTPATH=${1:-/tmp/out/}
doit() {
echo "$1" "$2"
hcopy -r "$1:*" "$2" 2>&1 >/dev/null | sed 's/hcopy: "//g; s/": is a directory//g' | while read x; do
NEWPATH="$OUTPATH/${x//://}"
mkdir -p "$NEWPATH"
doit "$x" "$NEWPATH"
done
}
mkdir -p "$OUTPATH"
doit "" "$OUTPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment