LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-15-2013, 02:37 AM   #1
fereshteh
LQ Newbie
 
Registered: Jul 2013
Posts: 24

Rep: Reputation: Disabled
bash


hi all
i have seen one command line in my program's build.bash file. It is:
[code]if [ -n "${USE_PARALLEL_IO:+1}" ] && [ -n "${USE_MPI:+1}" ]; then if [ "${which_MPI}" = "mpich" ]; then ...
i want to know what is the meaning of && sign .
All the best
fereshte

Last edited by fereshteh; 09-15-2013 at 03:39 AM.
 
Old 09-15-2013, 02:48 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
It marks an "and list" So
Code:
command1 && command2
means "execute command1 and then execute command2".
Example:
Code:
sudo aptitude update && sudo aptitude safe-upgrade
You can find all this and more in your favourite (and free) bash manual.
Enjoy
jdk

Last edited by jdkaye; 09-15-2013 at 03:44 AM.
 
Old 09-15-2013, 02:53 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Please take a look at the bash manual here: http://www.gnu.org/software/bash/man...ref.html#Lists
In your if/then construct, you can think at && as logical AND, that means the condition is true if both the expressions inside square brackets are true.
 
Old 09-15-2013, 03:44 AM   #4
fereshteh
LQ Newbie
 
Registered: Jul 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
thanks

dear
many thanks for your reply and sending required link
cheers
fereshte
 
  


Reply


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
How to end the bash script using commands in bash not manually by pressing ctrl+c Sanpreet Singh Linux - Newbie 1 07-03-2013 02:04 PM
[SOLVED] Converting Script from Linux (GNU) Bash 4 to Solaris Bash 2.05 - Any cheat sheet? oly_r Solaris / OpenSolaris 6 05-03-2013 09:25 AM
Bash problem : -bash: [: /bin/bash: unary operator expected J.A.X Linux - Software 1 09-22-2011 06:52 AM
[SOLVED] Using a long Bash command including single quotes and pipes in a Bash script antcore Linux - General 9 07-22-2009 12:10 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM


All times are GMT -5. The time now is 08:35 PM.

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