export, readonly |
---|
|
export name[=word] ... export -p readonly name[=word] ... readonly -p |
---|
|
export modifies or prints the environment. readonly makes variables unmodifiable. |
---|
|
-p |
---|
Print the name of the command and the names and values of all exported (read-only) variables in such a way as to allow the shell to reread the output to re-create the environment (read-only settings). |
---|
|
With the -p option, both commands print their name and all variables and values that are exported or read-only, respectively. Otherwise, they apply the appropriate attribute to the named variables. |
---|
|
The versions of /bin/sh on many commercial Unix systems are (sadly) still not POSIX-compliant. Thus the variable-assignment form of export and readonly don't work. For strictest portability, use: |
---|
FOO=somevalue export FOO |
---|
BAR=anothervalue readonly BAR |
---|