set variable = value set [options] variable[n]= value set variable 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 nth word in the variable to value. (The variable must already contain at least that number of words.) If only variable is specified, set the variable to null. With no arguments, display the names and values of all set variables. See also “Predefined Shell Variables” earlier in this chapter. Only one of -f or -l can be given.
Set only the first occurrence of a variable to keep it unique.
Set only the last occurrence of a variable to keep it unique.
List only read-only variables, or set specified variable to read-only.
set list=(yes no maybe)Assign a wordlist %
set list=maybeAssign an item in existing wordlist %
set quote="Make my day"Assign a variable %
set x=5 y=10 history=100Assign several variables %
set blankAssign a null value to blank