小编Dra*_*gos的帖子

如果在Bash中工作,我怎么能这样做?

在bash中如何使这样的结构工作:

if (cp /folder/path /to/path) && (cp /anotherfolder/path /to/anotherpath)
then
  echo "Succeeded"
else
  echo "Failed"
fi
Run Code Online (Sandbox Code Playgroud)

if应该测试$?返回每个命令的代码并用&&绑定它们.

我怎样才能在Bash中做到这一点?

linux bash shell

4
推荐指数
2
解决办法
738
查看次数

标签 统计

bash ×1

linux ×1

shell ×1