Tuesday 21 June 2016

control operators in linux

There is the list and description of control operators in linux.
Control operators play vital role in bash programming.
It will definitely help you to master the control operators in linux within an hour

  • & (ampersand)

    It is one of the most useful control operators in linux.
    When any command in the shell is ended with &,
    the command starts to execute in the background
    Therefore you'll not have to wait for command to finish.
    You will get your shell back for another command
    while the previous command is executing in background
    For example:
    • root@kali:~#   sleep   12   &
    • Then the sleep operation will be executed in the background
    • In b/w we can perform another linux command.
    • It will also notify us when the command execution in background finishes

  • ; (semicolon)

    It is among the most useful control operators in linux.
    If we want to execute two or more commands on the single line,
    then we have to use ; in b/w the commands.
    the shell waiting for each command to finish before starting the next command.
      For example
    • echo   this is the tutorial on control operators in linux ; echo   it will teach about control operators in linux
    • The output will be
    • this is the tutorial on control operators in linux
      it will teach about control operators in linux

  • $? (dollar question mark)

    It is the shell parameter which stores the exit codes of
    the previous command in the command shell.
      For example
    • cd  /Desktop
    • echo  $?
    • Output is   0
    • cd   /Desktop
    • echo  $?
    • Output is  1

  • && (double ampersand)

    && is implemented by the shell as the logical AND.
    It enables the execution of the second command
    only if first command succeeds(i.e. it's exit code is 0)
      for example
    • echo linux is the best  &&  echo everyone knows that
    • linux is the best
      everyone knows that
    • mecho  linux is the best  &&  echo control operators in linux
    • bash: mecho: command not found

  • || (double vertical bar)

    || is implemented by the shell as the logical OR.
    It enables the execution of the second command
    only if first command fails(i.e. it's exit code is 1)
      for example
    • echo linux is the best  ||  echo everyone knows that
    • linux is the best
    • mecho  linux is the best  ||  echo control operators in linux
    • bash:  mecho:  command  not  found
    • everyone knows that

  • # (pound sign)

    It is one of the most frequently used control operators in linux. It is used to write shell comments
    Shell ignores everything written after the #
    It doesn't play any role in command execution or shell expansion
    • echo  control operators in linux  #it will print "control operators in linux" on the terminal
    • output is: control operators in linux

  • \ (escaping special characters)

    It enables the use of control characters,like  ;,/
    but without the shell interpreting it,
    this is called escaping characters.
      for example
    • echo this is linux  \;  it is very cool
    • output: this is linux ; it is very cool
    • echo control \"operators\" in \'linux\'
    • output: control "operators" in 'linux'

  • End of the line backslash

    It helps the line to extend upto the next line if it is ended with backslash
    When it is found at the end of the line,
    shell does not interpret the newline character and
    waits on for execution of the command line until a newline without backslash is encountered.
      For example
    • root@kali:~#   echo control operators in linux\
      > plays important role\
      > in text presentation
      control operators in linuxplays important rolein text presentation

6 comments:

  1. I DONT KNOW WHAT YOU HAVE BEEN THROUGH OR HOW LONG YOU HAVE BEEN LOOKING BUT THIS IS THE LAST STOP AS THERE IS A HACKER WHO CAN HELP YOU WITH SPY WARE ON YOUR CHEATING PARTNER OR UPGRADE YOUR SCHOOL SCORES OR HELP WITH RESULT AND CLEAR ANY CRIMINAL RECORD..

    HACKING OF FACEBOOK , EMAIL , AND BANK ACCOUNTS ARE HIS SPECIALTY.. EMAIL : GREENFR1007@GMAIL.COM OR SKYPE:SATISH.ANCHAN4

    BEST EVER

    ReplyDelete
  2. I got my already programmed and blanked ATM card to withdraw the maximum of $5,500 daily for a maximum of 6 years. I am so happy about this because i got mine last week and I have used it to get more then $350,000 and ready to pay more. United Hackers is giving out the card just to help the poor and needy though it is illegal but it is something nice is not like other scam pretending to have the blank ATM cards. And no one gets caught when using the card.
    WhatsApp: +351 965 761 372
    Email : unitedblankatmhackcard@gmail.com

    ReplyDelete
  3. Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **Price for One SSN lead 2$**

    All SSN's are Tested & Verified. Fresh spammed data.

    **DETAILS IN LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    ->Bulk order negotiable
    ->Hope for the long term business
    ->You can asked for specific states too

    **Contact 24/7**

    Whatsapp > +923172721122

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete

  4. Are you interested in the service of a hacker to get into a phone, facebook account, snapchat, Instagram, yahoo, Whatsapp, get verified on any social network account, increase your followers by any amount, bank wire and bank transfer. Contact him on hackintechnology@gmail.com +12132951376(WHATSAPP)

    ReplyDelete
  5. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete
  6. Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **PRICE 2$ FOR EACH LEAD/FULLZ**

    All Leads are Tested & Verified.
    Fresh spammed data of USA Credit Bureau
    Good credit Scores, 700 minimum scores.

    **DETAILS IN EACH LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER WITH EXPIRY DATE
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL, I.P ADDRESS
    ->EMPLOYEE DETAILS
    ->REALTIONSHIP DETAILS
    ->MORTGAGE INFO
    ->BANK ACCOUNT DETAILS

    ->Bulk order will be negotiable
    ->Minimum buy 25 to 30 leads/fullz
    ->Hope for the long term business
    ->You can asked for specific states/zips too
    ->Serous buyer will be warmly welcome

    **Contact 24/7**

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete