Ubuntu_16.04 [SOLVED]: How to run (./) a bash script located in the cloud?

Ubuntu_16.04 [SOLVED]: How to run (./) a bash script located in the cloud?

Home Forums Ubuntu 16.04 Ubuntu_16.04 [SOLVED]: How to run (./) a bash script located in the cloud?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36826

    Anonymous

    QuestionQuestion

    Using a ubuntu 16.04 what I do is :

    1. Download the .sh script using wget https://gist.githubusercontent.com/...
    2. Turn the .sh file executable sudo chmod guo+x sysInit.sh
    3. Execute the code through sudo ./sysInit.sh

    I was wondering if it is possible to run the code directly from the web.
    Would be something like: sudo ./ https://gist.githubusercontent.com/....

    Is it possible to do that?

    #36827

    Anonymous

    Accepted AnswerAnswer

    Yes, it is possible using curl and piping the result to sh.

    Try the following command.

    curl https://url-to-your-script-file/scriptFile.sh | sh

    Source: https://stackoverflow.com/questions/48001638/how-to-run-a-bash-script-located-in-the-cloud
    Author: Vivek
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.