GETPID(1)
๐ 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:
varmust be given without a dollar sign! Like, do not put a$in front of it. ๐varmust not contain=.
๐ง OPTIONS ๐ง
-eโ no autoimport. This is the default. ๐ค-Eโ autoimport! Instead ofexec(3)ing intoprog..., itexec(3)s intoimportas -ui var var prog.... This substitutesvarinto 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โ usegetpid'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
- nixpkgs unstable: execline 2.9.9.2
- nixpkgs unstable: execline-man-pages 2.9.9.1.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms