Azure batch - run multiple commands from command line on linux VM

我与影子孤独终老i 提交于 2019-12-11 15:55:05

问题


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"



来源:https://stackoverflow.com/questions/50118295/azure-batch-run-multiple-commands-from-command-line-on-linux-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!