Jump to content

Bash scripting

From Squishu Wiki
Revision as of 16:44, 4 July 2025 by Princesssquishuskush (talk | contribs) (Created page with "== 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 **** R...")
(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