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
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 |
Answer / mrinmoy
Only exported variables can be inherited by another program
while other variables can not be used.
Is This Answer Correct ? | 3 Yes | 0 No |
Differentiate multiuser from multitask.
Was unix the first operating system?
What is pattern matching in unix?
Which is the shell of unix?
Is the Process before and after the swap are the same? Give reason.
Is windows unix like?
Pipes support half duplex communication. But if we want full-duplex communications we should use two pipes between two processes. Is such situation can leads to deadlock? Write two scenarios that could leads to deadlock in such situations?
Does unix have a gui?
What is .profile unix?
What are the essential features of the unix operating system?
How to know the present working directory in unix?
Is mac a unix?