User Tools

Site Tools


shell-scripts-on-mac

Shell Scripts on Mac

Shell scripts on mac in a nutshell:

  1. Create a new shell script file with nano:
    nano script.sh
  2. Enter the following code to signify it's a shell script and to run a command:
    #!/bin/sh
    ls
  3. Make it executable with chmod:
    chmod 777 script.sh
  4. Run it with the sh command:
    sh script.sh

Schedule a Script on Mac

shell-scripts-on-mac.txt · Last modified: 2023/11/27 11:10 by Roman Sheydvasser