mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-13 09:24:03 +08:00
38b24c2325
This makes it so we link to the very top of the document instead of a special anchor we manually include. So clicking e.g. :doc:`string <cmds/string>` will link you to cmds/string.html instead of cmds/string.html#cmd-string. I would love to have a way to say "this document from the root of the document path", but that doesn't appear to work, I tried `/cmds/string`. So we'll just have to use cmds/string in normal documents and plain `string` from other commands.
39 lines
975 B
ReStructuredText
39 lines
975 B
ReStructuredText
.. _cmd-continue:
|
|
|
|
continue - skip the remainder of the current iteration of the current inner loop
|
|
================================================================================
|
|
|
|
Synopsis
|
|
--------
|
|
|
|
.. synopsis::
|
|
|
|
LOOP_CONSTRUCT; [COMMANDS ...;] continue; [COMMANDS ...;] end
|
|
|
|
Description
|
|
-----------
|
|
|
|
``continue`` skips the remainder of the current iteration of the current inner loop, such as a :doc:`for <for>` loop or a :doc:`while <while>` loop. It is usually added inside of a conditional block such as an :doc:`if <if>` statement or a :doc:`switch <switch>` statement.
|
|
|
|
Example
|
|
-------
|
|
|
|
The following code removes all tmp files that do not contain the word smurf.
|
|
|
|
::
|
|
|
|
for i in *.tmp
|
|
if grep smurf $i
|
|
continue
|
|
end
|
|
# This "rm" is skipped over if "continue" is executed.
|
|
rm $i
|
|
# As is this "echo"
|
|
echo $i
|
|
end
|
|
|
|
See Also
|
|
--------
|
|
|
|
- the :doc:`break <break>` command, to stop the current inner loop
|