0

I am planning on writing a bash script and I going to put it on GitHub. When users download it, I want it to turn into a terminal command. I know how to do this manually but I do not know how to do it in the script so that it would automatically do it.

Thanks for your help in advance!

James Ashwood
  • 469
  • 6
  • 13
  • 2
    I would not blindly run a shell script from an untrusted source. Take me as the average user here – hek2mgl Feb 25 '20 at 20:27
  • 3
    You cannot do better than giving your users the command they need to download and run the script. You can't change your script so that it will run as soon as it's downloaded. Users get to choose what they do with a downloaded file. – jeremysprofile Feb 25 '20 at 20:29
  • 1
    @jeremysprofile, Ok – James Ashwood Feb 25 '20 at 20:30
  • @hek2mgl, I understand what you are saying but you can see all of the source code on the download webpage. – James Ashwood Feb 25 '20 at 20:31
  • 1
    @TheCoderBoss531 Ok, fair point – hek2mgl Feb 25 '20 at 20:58
  • 1
    @hek2mgl - that's pretty naive ... https://nakedsecurity.sophos.com/2016/05/26/why-you-cant-trust-things-you-cut-and-paste-from-web-pages/ https://www.lifehacker.com.au/2016/05/be-careful-when-you-copy-and-paste-code-from-the-internet/ – tink Feb 25 '20 at 21:10
  • 1
    @tink Yeah, that's scary, but I think this question was about a shell script which executes automatically after download in terminal. No javascript involved :) – hek2mgl Feb 25 '20 at 21:37
  • @hek2mgl, Yeah. – James Ashwood Aug 09 '20 at 15:55

0 Answers0