What is the difference between a shell variable that is
exported and the one that is not exported?

Answer Posted / seshadri sethi

The Shell variable which is exported would available to all
the programs outside the Shell also. And the shell variable
which is not exported, would available for that shell or for
the shell program only, in which the variable is declared.



Export LANG=C
will make the variable LANG the global variable, put it into
the global environment. All other processes can use it.

LANG=C
will change the value only in the current script.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give some situations where typing error can destroy a program?

822


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

719


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

666


What is the difference between break and continue commands?

665


What does path stand for?

714






What is the default ubuntu terminal?

719


What is a batch file used for?

649


Write a command sequence to find the count of each word?

619


Is shell scripting a programming language?

673


What is shell variable?

604


What is eval in shell script?

743


What is shell terminal?

627


What are the types of script?

687


How to set an array in linux?

668


Print the 10th line without using tail and head command.

1787