在我的脚本中,我希望能够根据特定条件写入文件或stdout.我很好奇为什么这在我的脚本中不起作用:
out=\&1 echo "bird" 1>$out
我尝试了不同的引号组合,但我继续创建一个"&1"文件,而不是写入stdout.我该怎么做才能让我的工作方式如何?
bash redirect file-descriptor
bash ×1
file-descriptor ×1
redirect ×1