CONTINUE(1POSIX)
β¨ continue(1POSIX) β¨
okay bestie, welcome to the POSIX Programmer's Manual entry for continue π it lives in section 1, and yes it's the same continue you already know and love from your loops. no cap.
πΈ PROLOG πΈ
real talk first: this page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β so if you're on Linux, pls consult the corresponding Linux manual page for the actual tea on Linux behavior β. also possible: the interface isn't implemented on Linux at all. just so u know. π
π NAME π
continue β continue for, while, or until loop
like that's literally the whole name section. iconic.
π SYNOPSIS π
continue [n]
π¦ DESCRIPTION π¦
so here's the vibe. if n is specified, the continue utility shall return to the top of the nth enclosing for, while, or until loop. if n is not specified, continue shall behave as if n was specified as 1.
and what does "returning to the top of the loop" actually mean, you ask? π it means repeating the condition list of a while or until loop, or performing the next assignment of a for loop, and then re-executing the loop if appropriate. periodt.
the value of n is a positive decimal integer. now listen closely bestie:
- if
nis greater than the number of enclosing loops, the outermost enclosing loop shall be used. - if there is no enclosing loop, the behavior is unspecified. π¨ not a vibe. do not test this.
and the meaning of "enclosing"? it shall be as specified in the description of the break utility. go read ur sibling page, iykyk.
β¨ OPTIONS β¨
None. literally none. she said no options, only vibes. π
π OPERANDS π
See the DESCRIPTION. (yes, n lives up there. we're being efficient.)
π STDIN π
Not used. she doesn't read from stdin, she's above that.
π INPUT FILES π
None.
π§ ENVIRONMENT VARIABLES π§
None.
β ASYNCHRONOUS EVENTS β
Default.
π«Ά STDOUT π«Ά
Not used. nothing printed, no drama, silent queen.
π STDERR π
the standard error shall be used only for diagnostic messages. that's it. that's the whole job.
πΈ OUTPUT FILES πΈ
None.
π EXTENDED DESCRIPTION π
None. we keep it simple around here.
π₯ EXIT STATUS π₯
0β successful completion. slay. π>0β thenvalue was not an unsigned decimal integer greater than or equal to1. π yeah she'll clock u for that.
π CONSEQUENCES OF ERRORS π
Default.
ok and just a lil heads up: the following sections are informative β they're context, not requirements.
π¦ APPLICATION USAGE π¦
None.
β¨ EXAMPLES β¨
here's the moment you've been waiting for, an actual example π this one skips directories and yells about everything else:
for i in *
do
if test -d "$i"
then continue
fi
printf '"%s" is not a directory.\n' "$i"
done
like, if it's a directory, continue says "not my problem, next iteration" and moves on. the rest get called out by printf. so real.
π RATIONALE π
None.
π FUTURE DIRECTIONS π
None.
π SEE ALSO π
- Section 2.14, Special Built-In Utilities
β COPYRIGHT β
ok legal bestie moment, gotta include this fr fr:
portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. in the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. the original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
π and that's the whole page, bestie. IEEE/The Open Group dropped this in 2017, and it's filed under CONTINUE(1POSIX). go loop responsibly. π«Άβ¨
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms