GETPID(1)

๐Ÿ“ฆ version 2.9.9.2, in nixpkgs unstable

๐ŸŽ€ GETPID(1) โ€” General Commands Manual ๐ŸŽ€

okay so real quick before we even start: this is a page from the General Commands Manual section, bestie, and it's about to be your new fave little helper ๐Ÿ’–


โœจ NAME โœจ

getpid โ€” stores getpid's process ID in a given environment variable, then executes a program ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

getpid [-E | -e] [-P | -p] var prog...

๐Ÿ’… DESCRIPTION ๐Ÿ’…

So here's the whole vibe: getpid takes its own PID, stashes it in the var variable, and then exec(3)s into prog with all its arguments. That's it. That's the whole thing. Iconic behavior, honestly ๐Ÿ‘‘

Couple of ground rules though, no cap:

  • var must be given without a dollar sign! Like, do not put a $ in front of it. ๐Ÿ™ˆ
  • var must not contain =.

๐Ÿงš OPTIONS ๐Ÿงš

  • -e โ€” no autoimport. This is the default. ๐Ÿ’ค
  • -E โ€” autoimport! Instead of exec(3)ing into prog..., it exec(3)s into importas -ui var var prog.... This substitutes var into the command line instead of putting it into the environment. Big difference, iykyk ๐Ÿ”ฅ
  • -p โ€” get the PID of the current process. This is the default. ๐Ÿ’ซ
  • -P โ€” use getpid's parent PID instead. Family drama ๐Ÿ‘€

๐Ÿ”ฎ SEE ALSO ๐Ÿ”ฎ

emptyenv(1), envfile(1), exec(1), execline-cd(1), execline-umask(1), exit(1), export(1), fdblock(1), fdclose(1), fdmove(1), fdreserve(1), fdswap(1), getcwd(1), heredoc(1), piperw(1), posix-cd(1), posix-umask(1), redirfd(1), trap(1), tryexec(1), unexport(1), wait(1), withstdinas(1), exec(3)

This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/getpid.html ๐ŸŒˆ


๐Ÿซถ AUTHORS ๐Ÿซถ

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

fr fr, that's the whole page. go forth and store those PIDs ๐Ÿ“

and that's a wrap, bestie โœจ this one's Debian, dated March 13, 2022 ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from