我想模拟Bash函数的返回值,我想知道是否可以使用即席文件描述符来传递该值。
换句话说:
function myfunction {
# print `stdout_value` to stdout
# print `stderr_value` to stderr
# print `return_value` to FD3 (or other)
}
# the values printed to stderr/stdout should be printed,but only
# `return_value` should be assigned to `myvalue`
myvalue=$(myfunction <FDs manipulation>)