11 lines
247 B
Bash
Executable File
11 lines
247 B
Bash
Executable File
#! /bin/sh
|
|
# make-parent-dirs : lines path |> lines directory
|
|
# List all parent directories of a path.
|
|
set -euf
|
|
|
|
set -- "$(sed -n 's|/[^/]*$||p' | grep . | sort | uniq)"
|
|
if echo "$1" | grep -q .; then
|
|
echo "$1"
|
|
echo "$1" | make-parent-dirs
|
|
fi
|