Hi all,
Want to know what does export command do??
What is its functionality?
And on a shell prompt
$at=1
$ echo $at
1
The variable above is it available to other script???
Hi all,
Want to know what does export command do??
What is its functionality?
And on a shell prompt
$at=1
$ echo $at
1
The variable above is it available to other script???
It takes a local variable and makes it global.
Try running a script that calls a function or another script. If the secondary script or function sets a LOCAL variable, it is gone when that function of script returns to the parent. If that variable is exported, it is a GLOBAL variable that will remain.
1:-Want to know what does export command do??
What is its functionality?
The Best way to approach .. Go for the man page of "export" and "env" command.
2:- $at=1
$ echo $at
1
The variable above is it available to other script???
NO, It will be only for that terminal/shell. But if you want use that variable into your another scripts. You must have export it.
Thanks
Sanjay