stockholm/bin/make-parent-dirs

11 lines
247 B
Plaintext
Raw Normal View History

2015-05-20 23:56:08 +00:00
#! /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