Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -eu
- list=$(mktemp)
- trap 'rm -f -- ${list}' EXIT
- cat - >${list}
- n=$(wc -l <${list})
- dir=$(head -1 ${list} | xargs dirname)
- while (( n != $(find ${dir} -type f | wc -l) )); do dir=$(dirname ${dir}); done
- echo $(basename ${dir})
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement