RSUB(1)

πŸ“¦
version 3.3 Β· 2 versions
, in alpine 3.24

πŸ’… RSUB(1) β€” the girlies' guide to rsub ✨

okay so bestie, welcome to rsub(1), from the General Commands Manual section, and honestly? she's that girl. πŸŽ€


🌸 NAME 🌸

rsub β€” substitute lines or a whole block of text, no cap πŸ’–


✨ SYNOPSIS ✨

rsub [-A] -r line_regex -l line_text target
rsub target < block_content

like, two whole ways to run her, pick your fighter 🫢


πŸ’« DESCRIPTION πŸ’«

so rsub is literally shipped to remote machines by rset(1), bestie β€” her whole job is giving a standard method of modifying configuration parameters within a file. it's giving ✨consistency✨. two modes of operation are supported: line substitution and block replacement, and both of them ate πŸ”₯

single line replacements get defined by the flags -r and -l, while the content for a text block gets handed over on STDIN. iykyk.

the arguments for line substitution are as follows, and yes i'm listing every single one because we don't skip 🧚:

πŸŽ€ line substitution args

  • -A β€” append the line if the pattern is not found. like she'll make room for you, queen πŸ‘‘
  • -r β€” a regular expression matching the line to replace. the vibe check for which line gets picked πŸ™ˆ
  • -l β€” the replacement text for a matching line. newlines are not permitted as part of the replacement string β€” one line only, periodt πŸ’…

πŸ¦‹ ENVIRONMENT πŸ¦‹

🌈 RSUB_DIFF_ARGS

arguments for the diff(1) tool. the default is "-U 2", iconic default honestly πŸ’œ

🌈 RSUB_START and RSUB_END

these define the beginning and ending markers when updating a block of text. the little goalposts of your block, bestie 🎯


⭐ EXIT STATUS ⭐

the rsub utility exits with one of the following values β€” memorize these, they're the whole personality 😭

  • 0 β€” target file was updated, slay πŸ’…
  • 1 β€” no changes were made, or an error occurred πŸ’€
  • 2 β€” incorrect parameters, we messed up bestie πŸ™ˆ
  • 3 β€” file not found πŸ“

πŸ”₯ EXAMPLES πŸ”₯

🌸 ensure a single configuration parameter is set

$SD/rsub -r '^AllowTcpForwarding .+' -l 'AllowTcpForwarding yes' \
        /etc/ssh/sshd_config

literally one line and the parameter is set. obsessed πŸ”₯

πŸ’– update a managed block of text

$SD/rsub /etc/fstab <<-CONF
/dev/ada0p1  /vm  ufs  rw  0  0
CONF

heredoc on STDIN, block replaced, main character energy only πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

awk(1), rinstall(1) β€” go read those too, bestie, they're friends of hers 🫢


mwah πŸ’‹ this page came to you from Debian, dated January 17, 2026, and stamped RSUB(1) β€” version, source and date all accounted for, because we keep every detail around here. bye bestie, go update some config files! πŸ’–βœ¨

πŸ“¦ where this page comes from
  • alpine 3.24: rset-doc 3.3-r1 Β· ISC
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms