TIMED-PROCESS(1)

πŸ“¦ version 1.32, in nixos 26.05, nixpkgs unstable

πŸ’… TIMED-PROCESS(1) β€” the perl section of the manual, bestie πŸŽ€

okay so real talk, this one lives in the User Contributed Perl Documentation corner of the man pages, and honestly? she's giving "small script, big main character energy." 🌟


✨ NAME ✨

timed-process β€” run a background process for a limited amount of time β³πŸ’–

Like, you give it a time limit and it will hold your little command to it. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

timed-process [-e exit_status] timeout command [<arg> [<arg> ...]]

ok so it's timed-process, then optionally -e exit_status, then your timeout, then the command, then however many <arg>s you wanna pass along. the way that syntax just flows 🫢


🌸 DESCRIPTION 🌸

so here's the tea, bestie: this script runs command for a specified amount of time, and if it doesn't finish? it kills the process. periodt. πŸ’€βœ¨

if command runs and exits before the given timeout, timed-process returns the exit value of command. slay, normal behavior, love that for you.

but if command did not exit before timeout seconds, then timed-process will kill the process and return an exit value of 255 β€” unless the -e command line option is set, which instructs timed-process to return a different exit value instead. πŸ”₯

ngl this is the whole point: it lets the user of timed-process figure out whether the process ended normally or was straight-up killed. exit 255 = "bestie got got." πŸ’…

🧚 a lil sign-off πŸŽ€

this icon of a man page is brought to you by perl v5.42.3, dated 2023-04-22 β€” written in the TIMED-PROCESS(1) era and honestly she ate. πŸ“πŸ’œ

πŸ“¦ where this page comes from