SLEEP(1plan9)

πŸ’€ SLEEP(1plan9) πŸ’€

okay bestie, this is the Plan 9 manual, section 1 β€” you know, the general commands section? yeah. and today's main character is sleep. ngl it's a short one but it's lowkey iconic. let's get into it. πŸ¦‹


✨ NAME ✨

sleep β€” suspend execution for an interval

like. literally just. pause. that's the whole job. and it ate. πŸ’…


🌸 SYNOPSIS 🌸

sleep time

πŸ’– DESCRIPTION πŸ’–

Sleep suspends execution for time seconds.

that's it. that's the whole paragraph. it pauses your little process for however many seconds you told it, and then it gets back up like nothing happened. no cap. πŸŽ€

heads up: time is in seconds. it is a plain old number, so don't be out here writing 5s or 1m and expecting ✨magic✨. it's seconds. periodt.

🫢 EXAMPLES 🫢

okay so here's where it gets fun. two real ones:

Execute a command 100 seconds hence. πŸ•

{sleep 100; command}&

it's giving "set a vibe-timer and dip." the & sends the whole thing to the background so you're not just sitting there staring at your terminal for a hundred seconds like πŸ™ˆ.

Repeat a command every 30 seconds. πŸ”

while (){
     command
     sleep 30
}

infinite loop, command, nap for thirty, command, nap for thirty, forever and ever amen. the while (){ } with nothing in the parens means "run this forever," which is very main character energy of it. 🧚


πŸ“ SOURCE πŸ“

/src/cmd/sleep.c

go read the source if you want, it's right there, go off. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


okay that's the whole page, and honestly? short, sweet, slayed. this was the Plan 9 manual, section 1, SLEEP(1plan9) β€” mwah, no notes, 10/10, would suspend execution again. ⭐ bye bestie, go take a nap (or make your computer take one). πŸ’œπŸŒˆπŸ“

πŸ“¦ where this page comes from