Scripts

The last and most powerful weapon in the UNIX wizard’s bag of tricks is a powerful scripting language that allows new commands to be created. Use vi or any text editor to create a file of commands called a script. This script can accept filenames on the command line or prompt the user for input. It can test the input to make sure it is valid. It also can execute other UNIX commands and take appropriate action if there are problems.

Any time you find yourself wasting time by repeating the same commands or key strokes, there is probably a way under UNIX to automate the process. No other operating system has such powerful features to avoid repetition. This is the reason UNIX gurus moan so much when forced to work on other operating systems. ...

Get Practical UNIX 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.