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.
I'm looking at compiling Mplayer and the instructions I'm following keep using the string && in their descriptions. For example:
./configure --prefix=/usr &&
make &&
make install
comes up for the Installation of GLib. This is the same for instructions for other applications/libraries. Is this indicating that I should type in an appropriate directory/file name or something else?
Which basically means that you should run the commands ./configure --prefix=/usr and make and make install. First run the ./configure command and when that is done, run make etc.
Whereas:
&&
Means: Only complete the next step if this first steps completes successfully (or has an output of 1). It's very useful in compiling a bunch of steps that require the first ones to complete successfully, such as configure:
./configure --with-whatever &&
make
Because you don't want to run make unless you have everything configured properly.
MasterC, you indicate that the && are used in a single string entered on the command line that the computer is to interpret as a sequence of events that are to occur if only the previous one does, whereas Thereof makes me think that they are basically shorthand instructions to the user. If I am correct, which one of you is right?
When a proram executes successfully, it gives the value '0' to the os to show that it did. If it gives something else, there was an error.
'&&' is the logical AND. It works like this:
true && true = true
true && false = false
false && true = false
Let's say the 0 a program returns to the os is 'true', and anything else is 'false'. You have two programs, A and B:
A && B
If A is successful, A=true. If not, it is false. Say A failed. This would be the result:
false && true
Which means the operation overall failed. The computer is lazy, and doesn't even run program B, because it knows the result of 'false && true' is false no matter what B is.
Originally posted by timsch75 MasterC, you indicate that the && are used in a single string entered on the command line that the computer is to interpret as a sequence of events that are to occur if only the previous one does, whereas Thereof makes me think that they are basically shorthand instructions to the user. If I am correct, which one of you is right?
thanks
Just to be direct - && is entered on the command line (or in the code) and is also a general instruction to the user in docs. They can type it exactly, as MasterC indicates, or type it in sequence as Thereof says (logically equivalent, but more steps for the user) - but it's intended as a single command string. So they're both right - but MasterC is righter.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.