stockholm/bin/make-parent-dirs
2015-05-21 01:56:08 +02:00

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