Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 09-22-2013, 04:05 PM   #1
jon lee
Registered: Jul 2013
Posts: 81

Rep: Reputation: Disabled
I need some shell script help for dependency checking.

What I'm looking to do is make a list of files that have "not found" dependencies.

For ex:
cd /usr/bin
ldd * | grep "not found"

which gives me something like this:
Quote: => not found => not found => not found => not found => not found => not found => not found => not found
but the above doesn't give the file name of the actual binary that has dependencies that aren't found. I'm looking for a shell command/script that will (also) give the file name of the files that have un-found dependencies. (somehow pipe it into ls, or a loop of some sort? ).

This should be an easy question for someone who knows what they're doing. I feel like a dunce for not being able to figure it out. (I tried a few things and messed up the ldd script and had to replace it. After that; I decided, instead of causing more damage, I would simply ask). Thanks beforehand.
Old 09-22-2013, 04:21 PM   #2
Alien Bob
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,789

Rep: Reputation: Disabled
This would already give you better results, but there are more complete solutions out there:
for FILE in $(find /usr/bin -type f)
  NOTFOUND=$(ldd $FILE | grep "not found")
  if [ -n "$NOTFOUND" ]; then
    echo -e "$FILE\n$NOTFOUND"
1 members found this post helpful.
Old 09-22-2013, 04:37 PM   #3
jon lee
Registered: Jul 2013
Posts: 81

Original Poster
Rep: Reputation: Disabled
Well that was quick. It's exactly what I was looking for. It works. Thanks very much!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bash shell script -checking permissions ? connect2janu Programming 5 04-04-2012 02:28 AM
Checking Database it running or not by using shell script ramslinux Linux - Software 4 07-21-2011 02:04 PM
[SOLVED] Checking Database it running or not by using shell script ramslinux Programming 3 07-21-2011 04:57 AM
cluster job checking and c-shell script bostonuser Programming 4 06-08-2009 04:37 PM
Proccess checking within shell script khutze Programming 2 08-12-2002 01:07 PM

All times are GMT -5. The time now is 05:07 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration