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

Answer Posted / tony

By default, Shells will only keep all variables to the Shell in which they run. This is good, since it assumes variables are not needed outside of a given script. In most cases, that is correct. But, if you have a script that you want to use to set Shell variables, it must be exported in some way. Alternative ways to export variables, is to call a script with "source" or just with a dot and a whitespace.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is bash shell command?

746


What is bash command used for?

789


What is the equivalent of a file shortcut that we have a window on a linux system?

839


Why are there shells on the beach?

840


c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command

4973


What is shell company all about?

771


What is a boot block?

768


How will you copy a file from one machine to other?

773


When should shell programming/scripting not be used?

827


What is the conditional statement in shell scripting?

910


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

1216


What is shell geeksforgeeks?

788


how will you find the total disk space used by a specific user?

808


What is meant by $1 in shell script?

740


What are scripts in psychology?

798