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 n is 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 β€” the n value was not an unsigned decimal integer greater than or equal to 1. 😭 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

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