Writing bash script in mac is fair easy job to do, and can automate a lot of stuff to save your time.
1. First step is to open a file using any of text edits you have
2. Make sure you add #!/bin/bash in the head of the file.
#!/bin/bash tells the terminal that you are using bash shell
echo hello world prints out “hello world” in the terminal
3. Go to terminal, go to the file folder and use below command:
ps> chmod 700 [file_name]
4. Execute your shell script
ps> ./[file_name]