Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi!
I've been reading a bit about bash and came upon the ldd command. I thought I'd try it with vlc to see the dependencies. Of course I needed the path to the vlc executable first, which i got with "which vlc". This outputs "/usr/bin/vlc" as a string that I could type (or copy) as an argument to ldd. Then I thought, why should I go through the trouble and not use "which vlc|ldd" instead? After all isn't this what pipe redirection is for; Passing the output of the first command as an argument to the second? I also tried "which vlc|ldd -" but that didn't work either. Am I missing something or is it just that ldd doesn't work that way?
Thanks for the quick replies. I hadn't thought of this approach. It works indeed, and so does "ldd `which vlc`" which also executes the command and feeds the result to ldd. Is there an advantage to one approach or the other or is it just a matter of preference?
The method with `` is the first method I learned and works fine for everything I have done. With $(), from my understanding, is a more recent way of doing it and is a lot easier to see what is going on when scanning large amounts of code, however it may only work in bash or korn shells.
If anybody has more info on this than I can provide I would be interested in it as well (links etc).
Basically, the backquote method `` is the original style on Unix eg BSD, Solaris, HP-UX, AIX etc.
The $() is newer and I think(?) probably only since the later version of ksh or possibly since the advent of Linux.
Its as well to recognise both if you work in the commercial environment.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.