Jump to content

Bash scripting

From Squishu Wiki
Revision as of 11:50, 5 July 2025 by Princesssquishuskush (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

General

  • Run a script
    • /bin/sh blah.sh
  • Make executable
    • chmod +x blah.sh

Run it now that it's executable

  • ./blah.sh
  • You could create a bin directory for yourself
    • mkdir ~/bin
    • Add it to your path
      • Edit your .bash_profile
      • MAC - edit .zprofile
        • vi ~/.zprofile
        • Add this line to the end of the file
        • export PATH="/Users/bbasura/bin:$PATH"
        • Log out and back in
        • chmod u+x /Users/bbasura/bin/blah.sh
        • cd /Users/bbasura/bin
        • Run simply with: blah.sh

Example Scripts