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 |
What is unix and why is it important?
How to remove the directory in unix?
What is pipe in unix example?
What is a unix file?
Is it possible to restrict incoming message?
In what way the Fault Handlers and the Interrupt handlers are different?
What is a parent directory in unix?
"ls" command is showing all the subdirectoary and files which are present in the current directoary, i want to cut only directoary name. How to cut only name ?
How to display n-th line of a file in Unix?
Consider a TCP echo client which blocks on fgets which read input from standard input. If now the corresponding server process crashes, what will client TCP kernel receive? Can the client process receive that? Why or why not? How you solve the above problem?
Define a process group.
I want to invest in learning things that will get me good jobs in future. But wondering if Unix knowledge is something that is a MUST have or is it better to do any Data-warehouse tool (cognos, Qclik view, ETL etc..). Please suggest me.