Hey everyone - I'm very much a beginner when it comes to coding and I'm very confused as to how to utilise any that people have posted as answers to questions in Github? Most of the time someone posts a comment that has a nice script in it, but if I copy and paste that script into a notepad, save it as a .bash - do I still need to chmod it? Does doing that do something to the file itself? Previously I just pasted the code into a notepad ++, did an EOL conversion to mac and saved it but it still failed to run as a script in JAMF. Wondering if I still need to chmod the file?
Solved
How do I run a script someone has posted in a comment in Git?

Best answer by Samstar777
Hello JAMFNoob,
Here are the steps you can follow to run those scripts locally on Mac (assuming you want to run it on Mac)
- it is always recommend to have a good tool, I prefer BBEdit
- Copy the script content from GitHub
- Paste it in BBEdit or TextEdit (native Mac app)
- save the file with extension .sh on ~/Desktop (this will save on desktop) or any other location on your Mac
- go to terminal
- run chmod +x /path/of/file (This will give executive permission to your script)
- run sudo sh /path/to/file (when you use sudo in terminal, make sure you have administrative account in Mac)
- Enter Password and see the results
Hope this will help.
Regards,
Sam
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.