find-dll-deps.sh 319 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. if [ "$#" -lt 1 ]; then
  3. echo "Usage: $0 <command1> <command2> ... <commandN>"
  4. exit 1
  5. fi
  6. results=()
  7. for arg in "$@"; do
  8. while IFS= read -r line; do
  9. results+=("$line")
  10. done < <(ldd "$arg" | grep /usr/bin | awk '{ print $3 }')
  11. done
  12. printf "%s\n" "${results[@]}" | sort | uniq