Unsetting

When going through the examples earlier in the chapter, the variable Children was used several times. What was not shown was the command that was run in between to free up that variable so it could be used again. Here is a more complete listing of commands to let you see what was really going on:

$ echo ${Children[*]}
Meshia Andy Ashley Tommy
$ unset Children
$ echo ${Children[*]}

$

As you can see from the previous code, the unset command is followed by the variable to be freed. If the variable's value is not freed from memory, it cannot be set to something else. But, what about when you made Children a read-only variable? How do you get rid of it?

The quick answer is that you cannot. If you could, it would go against the basic idea ...

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.