是否可以在不使用临时文件的情况下在不同的变量中存储或捕获stdout和stderr ?现在我这样做是为了out在err运行时获取stdout 和stderr some_command,但是我想避开临时文件.
out
err
some_command
error_file=$(mktemp) out=$(some_command 2>$error_file) err=$(< error_file) rm $error_file
bash shell command-line io-redirection
bash ×1
command-line ×1
io-redirection ×1
shell ×1