Re:Bash functions are better than I thought
by Groxx on Sunday October 31, 2021 @05:49PM
(#29060777)
yeah, I was wondering if there was some reason that something like this wouldn't work:
err_f="$(mktemp)"
third_f="$(mktemp)"
out="$(cmd 2>"$err_f" 3>"$third_f")"
err="$(cat "$err_f")"
third="$(cat "$third_f")"
Seems like that should work fine, and it's not even that odd looking or hard to understand. But I haven't tried, not sure if there's some surprise lurking in the depths of tempfiles or something.
Re:Bash functions are better than I thought
by gpderetta on Monday November 01, 2021 @06:56AM
(#29065120)
Normally I use mkfifo then immediately rm it after opening the file with exec.
The fact that there isn't a good way to open an anonymous pipe and get its two file descriptors in bash is very annoying.
Re:Bash functions are better than I thought
by cryptonector on Sunday October 31, 2021 @10:55PM
(#29062627)
Few people know about `{varname}` I/O redirection...
Mind, if possible, it is even uglier than using stdout.