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