-->

Azure batch - run multiple commands from command l

2019-08-16 09:09发布

问题:

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 -cand then put the command in double quotes, like this: /bin/bash -c "chmod +x start.sh && ./start.sh"