PAMEXEC(1)
π pamexec β the Netpbm manual, bestie edition β¨
okay so first things first: this is the manual page for pamexec from the Netpbm User Manual, living its best life in the General Commands Manual section. it's giving "shell command on every image in your stream" energy and honestly? iconic. let's get into it π«Ά
β¨ NAME β¨
pamexec β Execute a shell command on each image in a Netpbm image stream
πΈ SYNOPSIS πΈ
pamexec
["command"]
[netpbmfile]
[-check]
Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. (yes bestie, the CLI is flexible like that π )
π DESCRIPTION π
This program is part of Netpbm(1).
pamexec reads a Netpbm image stream as input. For each image, it runs a specified shell command and supplies the image to it as Standard Input (with a pipe). so likeβ¦ every single image in the stream gets its own lil' turn with your command. one at a time. no cap. π
netpbmfile is the file name of the input file, or - to indicate Standard Input. The default is Standard Input.
Many Netpbm programs understand multimage Netpbm streams themselves, so you don't need to use pamexec to run the program on the images in the stream. Ideally, all Netpbm programs would have that capability, but multi-image streams are a relatively recent invention, so older Netpbm programs just process the first image in the stream and then stop. Even many recently written Netpbm programs work that way, since the authors aren't aware of the multi-image possibility. π (not the authors catching strays but go off)
Another way to process a multi-image stream is to use pamsplit to explode it into multiple files, one image per file. You can then process those files. it's giving "manual mode" but it works πββοΈ
To run your command on a subset of the images in the stream, use pampick to select the desired images from the input stream and pipe the result to pamexec. β¨ curated content only β¨
π¦ OPTIONS π¦
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options ), pamexec recognizes the following command line option:
-checkβ This causespamexecto exit without processing any further images if the command has a nonzero exit status. basically: one bad command and we're OUT. no more images for you π
π APPLICATIONS π
To make an animated GIF movie:
pamexec pamtogif myvideo.ppm | gifsicle --multifile >myvideo.gif
obsessed. ate. no notes. π§
β LIMITATIONS β
pamexec assumes all commands consume all of Standard Input. If yours doesn't (perhaps it just exits when it's seen enough), you can buffer through a temporary file like this, which copies the first 3 lines of every image (the PPM header) to Standard Output:
pamexec "cat >/tmp/x; head --lines=3 x" myvideo.ppm
π¨ bestie listen β if your command dips out early without slurping all of Standard Input, pamexec is gonna have a bad time. the temp-file workaround above is your bestie here, fr fr.
π HISTORY π
pamexec was new in Netpbm 10.56 (September 2011).
Michael Pot wrote it, borrowing from pamsplit. π«Ά
π₯ SEE ALSO π₯
pamfile(1), pampick(1), pamsplit(1), pnm(1), pam(1), cat man page
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/pamexec.html
okay that's the whole page bestie, you're officially a pamexec girlie now π
β¨
this masterpiece of a doc is brought to you by netpbm documentation, dated 21 December 2021 β and this recreation of it in the Pamexec User Manual style is signed off with all the love, slay, and :3 energy in the world. stay streaming, stay piped, periodt ππ¦πΈ
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms