Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Where is the manual for Ubuntu's break -command?

I run

~ master $ man break
No manual entry for break
~ master $ break
break: not in while, until, select, or repeat loop
~ master $

Without manual it is difficult to understand the purpose of the command. It may be linked to the for -loops of the C -codes of the kernel. I do not believe that it is the break for Bash.

share|improve this question
2  
break is a bash builtin, not a command. Type help break at the prompt. –  DaveParillo Dec 3 '09 at 0:58
    
Also try type -a break at the prompt. –  Dennis Williamson Dec 3 '09 at 4:34
add comment

4 Answers

up vote 5 down vote accepted

For Bash:

$ help break
break: break [n]
    Exit for, while, or until loops.

    Exit a FOR, WHILE or UNTIL loop.  If N is specified, break N enclosing
    loops.

    Exit Status:
    The exit status is 0 unless N is not greater than or equal to 1.

The error message you are seeing is issued by Bash. What is the context in which you are trying to understand "break"?

In C, break is a keyword. See this wikibook for more information. In part, it says:

A break statement will immediately exit the enclosing loop.

share|improve this answer
    
An answer that addresses the question! Yeah! –  DaveParillo Dec 3 '09 at 0:57
add comment

If I got your question right, what you are after is:

man bash

alternatively you can also issue:

man bash | grep -C5 "break [n]"

EDIT: Sorry, I missed your note about not being the bash break. :-| However I can't reproduce the error message you get. I get instead:

bash: break: only meaningful in a `for', `while', or `until' loop

What version of ubuntu do you use? What version of bash? Mine is version 4.0.33(1)-release (x86_64-pc-linux-gnu)... I am asking just in case the two different messages are both from bash but from different versions...

What does

which break

output to you? If it is a standalone program you will get the directory where the executable is located and thus probably be able to understand what installation is part of. If it is a bash (ot other shell) command it will silently fail (no output).

share|improve this answer
    
I use Ubuntu 9.10 –  Masi Dec 2 '09 at 21:30
    
I use Ubuntu 9.10 too (64 bit) so it does look like it is another program, indeed. –  mac Dec 2 '09 at 21:33
add comment

A googling came up with this link, suggesting that the break command you've come across is indeed not from bash; it's from zsh. Hence you should be able to get the correct manual by issuing man zshbuiltins.

share|improve this answer
1  
In case you are right the man command to issue would however be man zshbuiltins (see this: manpagez.com/man/1/zsh-4.3.4) –  mac Dec 2 '09 at 23:53
add comment

i also have an ubuntu 9.10 installation. if if issue:

media@faun:~$ break
-bash: break: only meaningful in a `for', `while', or `until' loop
media@faun:~$

you see that this output definitely comes from bash. if you issue

media@faun:~$ su -
media@faun:~$ find / -name "break"

and

media@faun:~$ which break
media@faun:~$ type break

you see that there is no other binary and that break is bash builtin. the manual to break is in the manual for bash.

media@faun:~$ man bash

the error message you get is indeed from using the builtin break in a situation it doesn't work. you can try it like this:

media@faun:~$ for i in 0 1
> do
> echo $i
> done
0
1
media@faun:~$
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.