问题
At the beginning, I created a pool with the following configuration:
"Publisher": "microsoft-ads"
"Offer": "linux-data-science-vm"
"Sku": "linuxdsvm"
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
When I run it manually from terminal it works. But Azure Batch writes the following in the stderr.txt:
chmod: cannot access '&&': No such file or directory
Is there some way to run multiple commands from single Command Line?
回答1:
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"
来源:https://stackoverflow.com/questions/50118295/azure-batch-run-multiple-commands-from-command-line-on-linux-vm