|
set
Create a shell variable and set it equal to some value.
SYNTAX set Print the value of all shell variables. set name ... Set name to the null string. set name=word ... Set name to the single word. set [-r] [-f|-l] name=(wordlist) ... (+) Set name to the list of words in wordlist. set name[index]=word ... Set the index'th component of name to word this component must already exist set -r (+) List only the names of shell variables that are read-only. set -r name ... (+) Make name read-only, whether or not it has a value. set -r name=word ... (+) Set name to the single word, and make read-only. Options -f Set only unique words keeping their order. -f prefers the first occurrence of a word -l Set only unique words keeping their order. -l prefers the last occurrence of a word.
Notes
In all cases the value is command and filename expanded.
The arguments can be repeated to set and/or make read-only multiple variables in a single set command. Note, however, that variable expansion happens for all arguments before any setting occurs. Note also that `=' can be adjacent to both name and word or separated from both by whitespace, but cannot be adjacent to only one or the other.
This is a tcsh shell command.
"Have no friends not equal to yourself." - Confucious (Analects)
Related commands:
unset - Remove variable or function names
Equivalent BASH command:
set - Manipulate shell variables and functions