0

Sorry, seems like a stupid question but I cannot find an answer (and am not on mac to test)!

In Windows, I open notepad and copy/paste in a bunch of curl commands, save as a .bat and click on it. Then it runs, easy peasy.

In Mac, will I get the same behaviour if I save the file as .sh? Do I need to install anything from terminal?

Simon Kiely
  • 5,880
  • 28
  • 94
  • 180
  • You might benefit from my just-written answer [here](https://stackoverflow.com/a/52776187/1281485). – Alfe Oct 12 '18 at 10:21

1 Answers1

0

Sure, and you don't even need the .sh extension although its handy to help you recognize scripts. Just open a text file in your favorite editor. Type in the curl commands you want to run and save the file. There are two ways to run the file from the bash shell. you can

source filename

Or type:

chmod +x filename

to make the file executable and then type

./filename

to run it.

Natsfan
  • 4,093
  • 3
  • 22
  • 29