blob: 6bd67fd319e1423996f8c8143f12dc17409eee31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/bin/sh
while read -r line; do
if [ -n "$paths" ]; then
paths="$paths
$line"
else
paths="$line"
fi
done
dirs="$(echo "$paths" | tr '\n' '\0' | xargs -0 dirname | sort | uniq)"
paths="$paths
$dirs"
while [ "$(echo "$dirs" | wc -l)" -ne 1 ]; do
dirs="$(echo "$dirs" | tr '\n' '\0' | xargs -0 dirname | sort | uniq)"
paths="$paths
$dirs"
done
echo "$paths" | sort | uniq | grep -v '^\.$'
|