问题描述
在一开始,我使用以下配置创建了一个池:
At the beginning, I created a pool with the following configuration:
提供: linux-data-science-vm
"Offer": "linux-data-science-vm"
Sku: linuxdsvm
"Sku": "linuxdsvm"
然后我要复制 start.sh文件并在VM上运行。
因此,我需要更改权限,以允许执行start.sh,然后再执行它。
Then I want "start.sh" file to be copied and run on VM.So, I need to change permissions, to allow execution of start.sh and then execute it.
chmod +x start.sh && ./start.sh
当我从终端手动运行时,它可以工作。
但是Azure Batch在stderr.txt中写入以下内容:
When I run it manually from terminal it works.But Azure Batch writes the following in the stderr.txt:
是否可以通过单个命令行运行多个命令?
Is there some way to run multiple commands from single Command Line?
推荐答案
您应使用 / bin / bash -c
启动命令,然后将命令放在双引号中,例如这个:
/ bin / bash -c chmod + x start.sh&& ./ start.sh
You should start the command with /bin/bash -c
and then put the command in double quotes, like this:/bin/bash -c "chmod +x start.sh && ./start.sh"
这篇关于Azure批处理-在Linux VM上从命令行运行多个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!