RLEXEC(1)

πŸ“¦ version 0.3.0, in alpine 3.24

πŸ’… rlexec(1) β€” like, the whole manual, bestie

okay so this is a page from the ARIF User Manual and it's about rlexec, which is genuinely one of those tiny tools that eats. let me tell you everything πŸ’–


✨ NAME ✨

rlexec β€” read lines and execute program. that's it. that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

rlexec [options] pathname [args]

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: rlexec interactively reads what you type using GNU Readline. yes, that Readline. the good one. with the history and the tab completion and everything ✨

and then, for each line of user input you give it, it executes the program referred to by pathname, passing args along as its command-line arguments.

one line in β†’ one program run out. repetitive queen behavior. periodt. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • -e β€” executes pathname even if the input line is empty. like, you gave it nothing and it still runs. committed to the bit. 🫢
  • -i replace-idx β€” when executing pathname, this replaces the value of the nth argument (counting from 1, bestie, from 1) referred to by replace-idx with the line of text you typed.
    • if this option isn't provided, or it has a value of 0, then the text gets written to standard input instead. different pipeline, same energy.
  • -n name β€” the Readline application name. default value is "rlexec".
    • this is what lets you have application-specific settings in a Readline init file. see the "Conditional Init Constructs" subsection of GNU Readline's user manual if you wanna go deeper (iykyk). πŸ“–
  • -p prompt β€” the prompt text printed before reading user input. default value is "% ". yes, percent-space. iconic, honestly.

πŸ”₯ EXIT STATUS πŸ”₯

the program exits with status 0 if there are no errors, or 1 if otherwise. simple. no notes. πŸ’€


🌈 NOTES 🌈

ngl, everything this program does can technically be achieved with a simple Bash script (read -e and friends). so like… yeah. πŸ™ˆ

but β€” and this is the whole plot twist β€” Bash resets Readline state after each read(1), which means you have to reinstall the completion functions if Bash isn't handling them for you. and that could be tricky to work around. lowkey a nightmare. 😭

so you may find this program useful when you're dealing with exactly those cases (e.g. when you're using arify(1)). that's the moment rlexec gets main character energy. ⭐


πŸ“ EXAMPLES πŸ“

copy each line to the Wayland clipboard:

$ rlexec -i4 -- wl-copy -t text/plain -- %

look at that -- doing its job. look at that % placeholder getting swapped for whatever you type. slay. πŸ’œ


Copyright (C) 2024 CismonX <admin@cismon.net>

permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation β€” with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.

you should have received a copy of the license along with this document. if not, see https://www.gnu.org/licenses/fdl-1.3.html. 🫢


⭐ SEE ALSO ⭐

arify(1), bash(1), readline(3) β€” go read them, bestie, they're the supporting cast πŸ’–


fr fr that's the whole page. nothing skipped, nothing invented. go forth and pipe things. 🌸

okay bye ily, this was rlexec version 0.1.0, dated Apr 10, 2024 β€” catch you on the next readline πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from