The bash's man page doesn't describe the following 3 bash builtin commands clearly: break, continue, suspend

Solution Verified - Updated -

Issue

  • The bash's man page doesn't describe the following 3 bash builtin commands clearly:  break, continue, suspend
  • Please see the man page of bash on Red Hat Enterprise Linux 5 first.
    break [n]
                  Exit from within a for, while, until, or  select  loop.   If  n  is
                  specified,  break  n  levels.  n must be >= 1.  If n is greater than
                  the number of enclosing loops, all enclosing loops are exited.  The
                  return  value is non-zero when n is <= 0; Otherwise, break returns 0
                  value.
     ...
      continue [n]
                  Resume  the  next  iteration of the enclosing for, while, until, or
                  select loop.  If n is specified, resume at the nth enclosing  loop.
                  n must be >= 1.  If n is greater than the number of enclosing loops,
                  the last enclosing loop (the ''top-level'' loop) is resumed.   When
                  continue  is  executed inside of loop, the return value is non-zero
                  when n is <= 0; Otherwise, continue returns 0 value.  When  continue
                  is executed outside of loop, the return value is 0.
     ...
           suspend [-f]
                  Suspend  the  execution  of  this shell until it receives a SIGCONT
                  signal.  When the suspended shell is a background process,  it  can
                  be  restarted by the fg command. For more information, read the JOB
                  CONTROL section. The suspend command  can  not  suspend  the  login
                  shell.   However,  when -f option is specified, suspend command can
                  suspend even login shell.  The return status is 0 unless the  shell
                  is  a  login shell and -f is not supplied, or if job control is not
                  enabled.
    
  • Let's see the man page of Red Hat Enterprise Linux 6's bash.
    break [n]
                  Exit from within a for, while, until, or  select  loop.   If  n  is
                  specified,  break  n  levels.  n must be >= 1.  If n is greater than
                  the number of enclosing loops, all enclosing loops are exited.  The
                  return value is 0 unless n is not greater than or equal to 1.
     ...
     continue [n]
                  Resume the next iteration of the enclosing for,  while,  until,  or
                  select  loop.  If n is specified, resume at the nth enclosing loop.
                  n must be >= 1.  If n is greater than the number of enclosing loops,
                  the  last  enclosing loop (the ''top-level'' loop) is resumed.  The
                  return value is 0 unless n is not greater than or equal to 1.
     ...
            suspend [-f]
                  Suspend the execution of this shell until  it  receives  a  SIGCONT
                  signal.   A  login  shell cannot be suspended; the -f option can be
                  used to override this and force the suspension.  The return  status
                  is  0  unless the shell is a login shell and -f is not supplied, or
                  if job control is not enabled.
    
  • As you see, each description of the said builtin commands on Red Hat Enterprise Linux 6 is not clearer than Red Hat Enterprise Linux 5's.  Since the builtin commands on Red Hat Enterprise Linux 6 work as well as Red Hat Enterprise Linux 5, each description in man page should be the same as Red Hat Enterprise Linux 5's.

Environment

  • Red Hat Enterprise Linux 6
  • bash-4.1.2-3.el6.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content