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

Answers were Sorted based on User's Feedback



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

Answer / madhavi

the major difference between the shell variable that is
exported and not is variable exported using export command
is global to all shell,where as the other shell variables
are local to their respective shells.

Is This Answer Correct ?    8 Yes 0 No

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

Answer / 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

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

Answer / shimpi

Exported variable is like GLOBAL variable which can be used
across teh scripts and UNIX servers.
Whereas Unexported variable can be the used within the
defined script itself.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / narendrasairam

What that makes the difference is its Access Scope.
An exported variable is available across the scrips unlike
an unexported one which is local to the script.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / 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

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

Answer / guest

Chile process will inharite the variable and its value v/s
will not inharit

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Shell Script Interview Questions

How to write a function?

0 Answers  


What are "c" and "b" permission fields of a file?

0 Answers  


What language is used in terminal?

0 Answers  


How does path variable work?

0 Answers  


Is shell a part of kernel?

0 Answers  


determine the output of the following command: echo ${new:-variable}

0 Answers  


c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command

0 Answers  


What is the command for " how many shell is running in your system or how many shell supported by your system " ?.

3 Answers  


Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

0 Answers   Cap Gemini, Wipro,


What is shell prompt?

0 Answers  


What is the equivalent of a file shortcut that we have a window on a linux system?

0 Answers  


‎What is a shell? · ‎Types of shell · ‎what is shell scripting?

0 Answers  


Categories