-
- # Get dependencies for coredump analysis
- # Use /proc/$PID/exe and ldd to get all shared libs necessary
- array=(${pids})
- # Add the /proc/ prefix using parameter expansion
- array=("${array[@]/#/\/proc\/}")
- # Add the /exe suffix using parameter expansion
- array=("${array[@]/%/\/exe}")
- dependencies=$(ldd "${array[@]}" | grep -v "not found")
- dependencies=$(awk '/=>/{print$(NF-1)}' <<< "$dependencies" | sort | uniq)
-