What is the difference between a shell variable that is
exported and the one that is not exported?
Answer Posted / tony
By default, Shells will only keep all variables to the Shell in which they run. This is good, since it assumes variables are not needed outside of a given script. In most cases, that is correct. But, if you have a script that you want to use to set Shell variables, it must be exported in some way. Alternative ways to export variables, is to call a script with "source" or just with a dot and a whitespace.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why is a script important?
What is inside a seashell?
Where are cowrie shells found?
Explain about login shell?
Why is it called a shell?
How will you pass and access arguments to a script in linux?
What is shell scripting used for?
Calculate a real number calculation directly from the terminal and not any shell script.
What are the four fundamental components of every file system on linux?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
What is shell variable?
What is the meaning of $1 in shell script?
What is a batch file used for?
What is the use of echo in shell script?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.