Process contents of an fd with a pipeline, concatenate fds

From: handpickencounter <handpickencounter_at_proton.me>
Date: Mon, 05 May 2025 17:52:27 +0000

If I have an fd and I need to replace all
the newlines in it with the null character, is there a better/idiomatic way to do
it than:

piperw ${fdr} ${fdw}

background -d {

fdmove 1 ${fdw}

fdmove 0 ${1}

tr \\n \\0

}

fdclose ${fdw}

If not then I would like this to be a feature request for

fdprocess

or something.

fdprocess ${fd_in} ${fd_out} { tr \\n \\0 }

I have also found a need for an fdconcat type of functionality and the only way I found to do it is more of the above.

Hopefully I'm just overlooking some capability somewhere.
Received on Mon May 05 2025 - 19:52:27 CEST

This archive was generated by hypermail 2.4.0 : Mon May 05 2025 - 19:53:02 CEST