I use scanelf -q -F "%n#F" -f /dev/stdin in my checkdeps.rb script http://a.bo.cx/svn/scripts/checkdeps.rb I just came accross a situation where a shared library installed by ibm-jdk-bin does not need any other shared library which made checkdeps.rb block indefinately because scanelf outputs nothing. We could change the behaviour so that it outputs only an empty line so it would be more easy to parse. For now I will work the issue by dropping -q and disrecarding the NEEDED FILE entry it produces when called on the first binary.
this is by design ... you requested quiet and the test returned nothing ... in this case, %n outputs the NEEDED entries and there are none so nothing is displayed what you probably want is: scanelf -B -F '%n#F' -f /dev/stdin