Results 1 to 4 of 4

Thread: Double Ampersand in bash script programming

  1. #1
    Join Date
    Jul 2009
    Posts
    42

    Double Ampersand in bash script programming

    Hi guys, I'm new to linux and started liking it already. I find programming quite fascinating and so have started with basic bash script programming. I was a little familiar with batch programming on in widows based systems. Well as i am new to bash and yet learning its obvious that i will come across problems. I want to know what Double Ampersand in bash script programming stands for? I hope i will get appropriate help soon... Thanks in advance...

  2. #2
    Join Date
    Jan 2009
    Posts
    289

    Re: Double Ampersand in bash script programming

    I am not very familiar with bash programming and scripting, but i know that some symbolic representation in all languages stands for the same thing. As i'm familiar with some C++ programming i can say double ampersand [&&] stand for conditional loops when you want two or more conditions to be true, then this symbol && is used. Double Ampersand simply means 'AND'. You can use double ampersand for boolean AND operation also or for comparision. You will get a fair idea as you implement this in your programs. I hope this helps you...

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Double Ampersand in bash script programming

    Bash script programming is not more different then batch programming of windows. The only difference is the syntax of commands that you use in [Windows and Linux] both the operating systems. Also bash needs to know which shell it will be executing programs for which isn't the case in batch programming of windows. Double Ampersand in bash represents AND operation. This can be used anywhere when such an instruction is needed. Like if you need to execute two commands or you need to exit two running child processes or anywhere at a time two or more then one task has to be performed...

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Double Ampersand in bash script programming

    Well, thats correct but not fully. In bas scripting and programming, Double Ampersand stands for pure AND. This means AND condition must be satisfied. Suppose you want to execute two instructions, you can also use other ways to do this, but if you use double ampersand, the second instruction will only be executed if the first one succeeds. Because if the first one fails then even if the second instruction succeeds, the AND instruction is not satisfied. So if the first instruction fails, it won't attempt to run the second one.

Similar Threads

  1. Bash script needs to e-mail output
    By Kim|ball in forum Technology & Internet
    Replies: 4
    Last Post: 27-05-2011, 10:19 AM
  2. How to create CGI script in bash?
    By Mulan in forum Software Development
    Replies: 5
    Last Post: 01-09-2010, 08:19 PM
  3. Create bash script for ftp
    By teenQ in forum Operating Systems
    Replies: 4
    Last Post: 04-03-2010, 07:37 PM
  4. Bash script if then else help
    By Unix'EM in forum Software Development
    Replies: 3
    Last Post: 18-08-2009, 06:34 PM
  5. BASH Programming Functions
    By Jackie in forum Software Development
    Replies: 1
    Last Post: 17-03-2009, 12:48 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,195,210.44664 seconds with 16 queries