Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这不起作用:
result=`./myscript.sh $@` 2> /dev/null
stderr仍然出现在我的屏幕上。我猜作业的分组不正确,但我真的不知道如何同时执行这两项操作(特别是在不创建临时文件的情况下)。
stderr
您可以使用:
result=$(./myscript.sh "$@" 2> /dev/null)
尝试:
result=`./myscript.sh $@ 2> /dev/null`