home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: repeat Chapter 5
The C Shell
Next: Reference: setenv
 

set



set

 

variable

 

=

 

value




set

 

variable



[



n



] = 



value




set

Set variable to value , or if multiple values are specified, set the variable to the list of words in the value list. If an index n is specified, set the n th word in the variable to value . (The variable must already contain at least that number of words.) With no arguments, display the names and values of all set variables. See also "Predefined Shell Variables" earlier in this section.

Examples

% 

set list=(yes no mabye)

	
Assign a wordlist

% 

set list[3]=maybe

	
Assign an item in existing wordlist

% 

set quote="Make my day"

	
Assign a variable

% 

set x=5 y=10 history=100

	
Assign several variables

% 

set blank

	
Assign a null value to 
blank


Previous: Reference: repeat UNIX in a Nutshell: System V Edition Next: Reference: setenv
Reference: repeat Book Index Reference: setenv

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System










??????????????@Mail.ru