CONTINUE(1P)

πŸ’– CONTINUE(1P) β€” POSIX Programmer's Manual πŸ’–

okay bestie, welcome to the glow-up of continue, from the POSIX Programmer's Manual. sit down, grab a strawberry πŸ“, because we're about to make loop control actually make sense.


🌸 PROLOG 🌸

so like, a lil heads up before we get into it: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β€” so if you're on Linux, go check the corresponding Linux manual page for the real tea on Linux behavior β˜•. or honestly? the interface might not even be implemented on Linux at all. vibe check accordingly. 🫢


✨ NAME ✨

continue β€” the "skip to the next round of the loop" queen. she continues for, while, or until loops. periodt. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

continue [n]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the whole deal:

if n is specified, the continue utility shall return to the top of the *n*th 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" even mean? bestie it means: repeating the condition list of a while or until loop, or performing the next assignment of a for loop, and re-executing the loop if appropriate. she's not just skipping β€” she's going all the way back up. πŸ”₯

the value of n is a positive decimal integer. if n is greater than the number of enclosing loops, the outermost enclosing loop shall be used. and if there is no enclosing loop at all? the behavior is unspecified. 😭 not a vibe, just don't.

the meaning of "enclosing" shall be as specified in the description of the break utility. (go read your girl break's page, they're a matched set πŸ’œ)


πŸ’… OPTIONS πŸ’…

None. she has no flags, she has no options, she simply is. iconic behavior honestly.


🌈 OPERANDS 🌈

See the DESCRIPTION. yes, that's it. that's the whole section. go back up. πŸŽ€


⭐ STDIN ⭐

Not used. she doesn't read from you, bestie.


🧚 INPUT FILES 🧚

None.


πŸ’œ ENVIRONMENT VARIABLES πŸ’œ

None. no environment variables here, she's low maintenance fr fr.


🌸 ASYNCHRONOUS EVENTS 🌸

Default.


✨ STDOUT ✨

Not used. not a single peep on stdout.


πŸŽ€ STDERR πŸŽ€

the standard error shall be used only for diagnostic messages. so if she's talking, something went wrong. 😭


πŸ¦‹ OUTPUT FILES πŸ¦‹

None.


πŸ‘‘ EXTENDED DESCRIPTION πŸ‘‘

None. nothing extra, she's already perfect.


πŸ”₯ EXIT STATUS πŸ”₯

  • 0 β€” Successful completion. slay. πŸ’–
  • >0 β€” the n value was not an unsigned decimal integer greater than or equal to 1. so basically you gave her bad input and she's letting you know. πŸ™ˆ

πŸ’… CONSEQUENCES OF ERRORS πŸ’…

Default.

the following sections are informative. (aka: the fun part, keep reading 🫢)


⭐ APPLICATION USAGE ⭐

None.


🌈 EXAMPLES 🌈

here's her moment, the actual example, verbatim, no cap:

for i in *
do
    if test -d "$i"
    then continue
    fi
    printf '"%s" is not a directory.\n' "$i"
done

see what she's doing? if $i is a directory, continue says "nope, next one" and skips the printf. only non-directories get printed. main character energy, honestly. πŸ‘‘


🧚 RATIONALE 🧚

None.


πŸ’œ FUTURE DIRECTIONS πŸ’œ

None.


πŸŽ€ SEE ALSO πŸŽ€

  • Section 2.14, Special Built-In Utilities

okay this part is the serious part, so let's do it properly:

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 🫢 this iconic lil doc came to you from IEEE/The Open Group, 2017 β€” CONTINUE(1P), that's the manual, that's the date, and that's a wrap. now go skip some loop iterations. you got this. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from