What is the difference between a shell variable that is
exported and the one that is not exported?
Answer Posted / mahendra swain
When we export the variable that will available in subshell
If simply define variable that is only available in current shell.
Example: #var=20
#echo $var
20
If you invoke #sh i.e subshell of bash and try to print that unexported variable valu you will not get that.
sh-2.05b# echo $var-----it does not print the valu of var b'caz still it is in bash shell memory.
Just see the exported variable in shell
[root@dhcppc0 root]# export var1=30
[root@dhcppc0 root]# sh
sh-2.05b# echo $var1
30
I hope you will be enjoy it.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
What is the full form of unix operating system?
What are the three main components of unix architecture?
What is source unix?
What is unix directory structure?
How do you kill a process in unix?
How to find out what processes are running in the background in unix?
What is pipe in unix example?
What is the main goal of the Memory Management?
What are new features added in nfs4?
You have a file called tonky in the directory honky. Later you add new material to tonky. What changes take place in the directory, inode, and file?
What are the main features of unix?
What is home directory in unix?
How would you identify daemons in unix?
What is the full meaning of unix?
What is architecture of unix operating system?