Korn Shell Options (set)

If you choose to use the Korn shell as your shell, there are many options you can use to change the behavior of the Korn shell. Many of these options are described in the ksh man pages, but I’ve listed a few in Table 3.2 that you might want to consider using.

Table 3.2. Korn Shell Options
Option Description
-a Automatically exports all variables
-C noclobber; prevents existing files from getting clobbered (overwritten) when you use >> or > (I/O re-direction). See the section on redirection later in this chapter.
-v verbose; displays each shell input line as it is read and is a good tool for debugging scripts.
-x debug; displays commands and arguments as the commands are executed and is another good tool for debugging scripts.

Apply the Korn shell options by issuing the set command. The set option is used in the sh, ksh, and csh shells to set and unset options. Here are a couple examples using the set command to set Korn shell parameters:

  • set –C (turn on noclobber)

  • set +C (turn off noclobber)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset