User Input

Getting input through to your teenager may require anything from a gentle tap on the shoulder to a shouted “Wassup?” But either way, the ultimate goal is to alter the behavior based on the input you supply. A shell script may be written such that it requires no input from the user. An example would be the masks_magic script from the previous chapter. A sample run is shown to refresh your memory:

$ mask_magic
Default regular file permissions with current umask (0002)
u  g  o
_________
rwxrwxrwx
110110100

Default directory file permissions with current umask (0002)
 u  g  o
_________
rwxrwxrwx
111111101

1s are on, 0s are off
$

Or it can be written so that it checks the contents of certain environment variables and branches inside of the ...

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.