How to Run a Script

Simply speaking, executing a script is as easy as typing its name at the shell prompt. Of course, if that were all there was to it, a whole section wouldn't be dedicated to it, now would it? A number of pieces must fall into place for a script to be executed. Here are a few of the prerequisites for script execution:

  • The permissions must be correct.

  • You must be able to locate the script through the PATH variable or through an absolute file specification.

  • System resources must be available to support the execution of the script.

  • The correct shell must be invoked to interpret the script's contents.

  • The script's syntax must be correct.

  • All files referenced during the run must be available.

  • The user interaction must be reasonable.

Get Korn Shell Programming by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.