#!/bin/sh [ -z "$1" ] || [ -z "$2" ] && { printf "Usage: create_fs_view.sh \n" ; exit 0 } [ -d "$1" ] || { printf "%s is not a directory\n" "$1" ; exit 1 } src="$(realpath "$1")" root="${src%/*}" pkg="${src##*/}" trg="$2" mkdir -p "$trg" 2>/dev/null #printf "src = %s\n" "$src" #printf "root = %s\n" "$root" #printf "pkg = %s\n" "$pkg" #printf "trg = %s\n" "$trg" stow -v -t "$trg" -d "$root" --no-folding "$pkg" find "$trg" -type l -exec detox -v --special '{}' \;