CDIST-TYPE__SED(7)

πŸ’– cdist-type__sed β€” the cdist manual page, bestie edition ✨

okay so this is cdist-type__sed(7), part of the cdist fam, and it's genuinely one of my faves. it's a __sed type. yes, THAT sed. the text-file-transforming legend. let's get into it πŸŽ€


🌸 NAME 🌸

cdist-type__sed β€” transform text files with sed πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

literally what it says on the tin: it transforms text files with sed. no cap. that's the whole vibe. ✨


πŸ‘‘ REQUIRED MULTIPLE PARAMETERS πŸ‘‘

these ones you GOTTA give, and you can give more than one, so don't skimp 🫢

  • script β€” the sed script, bestie. and listen: if you pass - as the value, then the script gets read from stdin instead. iconic behaviour fr fr.

πŸŽ€ OPTIONAL PARAMETERS πŸŽ€

optional but honestly kind of the moment:

  • file β€” path to the file. defaults to $__object_id if you don't say anything, which is lowkey convenient πŸ’–
  • onchange β€” run this command if sed actually changes the file. like, only if it changes. if nothing changed, nothing happens. periodt.

⭐ BOOLEAN PARAMETERS ⭐

flags that are just... on. no value, just vibes 🌈

  • regexp-extended β€” use extended regular expressions in the script. heads up though: it might not be supported with every sed version. so like, check your sed, bestie 😭

πŸ”₯ EXAMPLES πŸ”₯

here's the tea, in code, exactly as written:

__sed /tmp/foobar --script 's/foo/bar/'
echo 's/foo/bar/' | __sed foobar --file /tmp/foobar --script -

see that second one? piping the script in and using -? main character energy honestly πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

Ander Punnar <ander-at-kvlt-dot-ee> β€” thank you for your service πŸ«‘πŸ’–


🧚 COPYING 🧚

Copyright (C) 2021 Ander Punnar. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

(that's the GPL v3-or-later vibe, and yes you should read the actual license if you're gonna do the thing, iykyk πŸ“œ)


ungleich GmbH 2021 β€” periodt πŸ’…


and that's the whole page, bestie! no skips, no cuts, every flag accounted for 🌸

version 7.0.0, dated Jul 31, 2022 β€” from your cdist bestie with love, mwah πŸ’‹βœ¨πŸ¦‹

πŸ“¦ where this page comes from