我试图让bash处理来自stdin的数据,但是没有运气.我的意思是以下工作:
echo "hello world" | test=($(< /dev/stdin)); echo test=$test
test=
echo "hello world" | read test; echo test=$test
test=
echo "hello world" | test=`cat`; echo test=$test
test=
Run Code Online (Sandbox Code Playgroud)
我想要输出的地方test=hello world.我试过把""引号括起来"$test"也不起作用.