RUNBLOCK(1)

πŸ“¦ version 2.9.9.2, in nixpkgs unstable

RUNBLOCK(1) πŸ’… β€” from the General Commands Manual β€” execute an execline block

🌸 NAME 🌸

runblock β€” execute an execline block. That’s the vibe, bestie. πŸ’–

✨ SYNOPSIS ✨

runblock [-P] [-n argshift] [-r] n cmd...

πŸ’– DESCRIPTION πŸ’–

okay so runblock exists to help you write execline commands in the execline language. It can only be used inside an execline script β€” no cap. If the script has been given blocks as arguments, runblock lets you execute one of those blocks individually. It also lets you give those blocks as a set of arguments to another command. Slay. ✨

First, runblock skips the first argshift positional parameters. Why? So you can design commands that take simple arguments and blocks. Then runblock looks for and parses blocks (cf. execline-block(7)) in the positional parameters. πŸ¦‹

Here’s the flag tea, bestie:

  • -n argshift β€” this is the argshift situation: the first argshift positional parameters get skipped.
  • -r β€” if this option is present, runblock skips n blocks and execs into the remaining arguments.
  • -P β€” normally runblock pops (cf. execline-pushenv(7)) its environment frame before executing. If -P has been given, it does not pop.
  • n β€” without -r, runblock skips nβˆ’1 blocks and execs into the nth one.
  • cmd... β€” if cmd... is not empty, then instead of directly executing the block or the remainder, runblock appends the selected set of arguments to the cmd... command line.
πŸ’€ Of course, if the block structure doesn’t match, runblock exits 100 with an error message. Not the vibe, but important.

πŸŽ€ Credits πŸŽ€

The runblock idea, as well as the ifelse(1) idea, comes from Paul Jarc[1]. iconic behavior. πŸ‘‘

🌈 EXAMPLES 🌈

Suppose we want to implement the ifelse(1) command as an execline script, using the ifte(1) command. runblock lets us do it in a simple way:

#!/command/execlineb
ifte { runblock 2 } { runblock -r 2 } runblock 1

That’s it. Literally. πŸŽ€

πŸ¦‹ SEE ALSO πŸ¦‹

[1] https://code.dogmap.org/

This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/runblock.html

πŸ‘‘ AUTHORS πŸ‘‘

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

πŸ¦‹ Debian edition, dated February 14, 2021 β€” RUNBLOCK(1), signing off. stay slay, bestie. πŸ’…
πŸ“¦ where this page comes from