MDM-RUN(1)

πŸ‘‘ NAME πŸ‘‘

mdm-run β€” run a command in parallel with mdm-master

(also lowkey introducing its ride-or-die twin, mdm-sync β€” same energy, different job πŸ’…)


✨ SYNOPSIS ✨

mdm-run command
mdm-sync command

πŸ’– DESCRIPTION πŸ’–

okay so bestie, listen. mdm-run annotates command as a candidate for parallel execution. that's the whole vibe. πŸ¦‹

if an mdm-master process is present β€” and by "present" we mean the environment variable MDM_CMD_SOCK is defined, iykyk β€” then mdm-run submits command to the mdm-master, and it exits when the master issues the command to an mdm-slave process for execution. and the plot twist? that mdm-slave might be connected to a totally different terminal. not you. someone else. the multitasking is giving main character energy fr fr. 😭✨

meanwhile mdm-sync runs command in place, but it coordinates with mdm-master to make sure that executing command does not interfere with commands that are currently executing in parallel. it's the responsible friend. the designated driver. the one who texts the group chat "we're all getting home safe." 🫢

πŸŽ€ but WAIT. if there is no mdm-master process present (i.e., the environment variable MDM_CMD_SOCK is not defined), then both mdm-run and mdm-sync simply run command as if you entered command all by itself. no drama. no coordination. just you and your command, alone together. πŸ’€

these programs are a part of the Middleman System (mdm). iconic family. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • none. neither mdm-run nor mdm-sync accepts any options. that's it. that's the section. no flags, no short forms, no long forms, nothing to memorize, we love a low-maintenance icon. 🌸

⭐ EXIT STATUS ⭐

  • if there is no mdm-master process present, the exit status of mdm-run is the exit status of command. simple. honest. transparent. 🌈
  • if an mdm-master process is present, the exit status is 0 if and only if command is successfully issued to an mdm-slave process for execution. (note: that's issued, not finished. read it again bestie, it matters. πŸ™ˆ)
  • the exit status of mdm-sync is always the exit status of command. always. every time. no notes. periodt. πŸ’―

πŸ”₯ ENVIRONMENT πŸ”₯

the mdm system uses the following environment variable for internal communication, and thus you should not try to set them yourself. hands off, bestie, it's not yours. πŸ™…β€β™€οΈ

  • MDM_CMD_SOCK β€” mdm-run uses this environment variable to decide whether a mdm-master process is present. that's literally its whole job. it's the vibe check. 🧚

πŸ“ EXAMPLE πŸ“

see mdm.screen(1) for an example use of mdm-run. go read it, it's giving tutorial. ✨


🌸 SEE ALSO 🌸


mwah πŸ’œ that's the whole page, bestie. this one's from the Linux corner of the world, dated 2009-03-06, and yes, it has been serving MDM-RUN(1) realness since before some of us could read. go run something in parallel, you absolute legend. πŸŽ€πŸ¦‹πŸ’