Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

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

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

Post New Answer

More Unix General Interview Questions

How do you kill a job in unix?

0 Answers  


What is unix and why it is used?

0 Answers  


How do I find the port number of pid in unix?

0 Answers  


What is unix operating system explain various components of unix operating system?

0 Answers  


Suppose you have a scheduling chain where the process 1 is a predecessor of the process 2 and both of them are scheduled every Monday at 8.00pm. Will I find execution log of process 1 every Tuesday morning? And what about the other one? Why?

1 Answers   Accenture, IBM,


Is unix a kernel?

0 Answers  


command to view process running?

8 Answers   TCS,


Describe a link in unix.

2 Answers  


What are links and symbolic links in UNIX file system?

0 Answers  


What are the essential features of the unix operating system?

0 Answers  


What is the difference between unix and windows operating system?

0 Answers  


What are the bits that support the demand paging?

0 Answers  


Categories