Shell scripting

  • Shell scripting is kind of a catch-all term for putting a series of commands into a single executable file.

  • An example.
  • How do we use this file?
  • %> chmod +x example1.sh -- first make it executable
  • %> ./example1.sh -- then simply execute it

  • You can use variables in shell scripts too.
  • Another example.
  • %> chmod +x example2.sh -- make it executable
  • %> ./example2.sh trilling -- did it work?

  • There are lots and lots and LOTS of other things you can do with shell scripts.
  • For example, you can do loops, conditional statements, math, and so on.
  • And of course, you can have shell scripts call other shell scripts, etc.

  • Here's a good reference.