|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
what does this do ?
In following code fragment (ksh) what does the export statement actualy do....?
(The rest of script is completly devoid of any functions and never sources another script) echo "Enter Record Number" if read REC? 'Record Number ' then export REC else echo "\n\nERROR: Invalid Record number" echo "Only numbers are permitted" echo "Process Aborted\n\n" exit 1 fi |
|
#2
|
|||
|
|||
|
export adds the variable incl. value to the shell environment which makes it globally accessible (hence, from the shell or from scripts that are started from this shell.
-Steven ____________ You ride a horse rather less well than another horse would. -Edmund Black Adder |
|
#3
|
|||
|
|||
|
so nothing then
so in the contex of the the script itself - NOTHING ??
Thats what I thought and so why I asked |
|
#4
|
|||
|
|||
|
export makes the variable available to the current process and all children of the current process. The parent of the current process does not 'leanr' abou the variable
|
|
#5
|
|||
|
|||
|
Quote:
well you can hardly call that nothing. It certainly will have some purpose, otherwise why be there? It would be a good guess, that this variable is required somewhere, likely in another script. There are of course other ways of passing parameters..... -Steven __________________ No. No, not really, the only change is if you could go and put your face in some manure and follow along at a reasonable distance, that would be fine. –Edmund Black Adder |
|
#7
|
|||
|
|||
|
freebsd, you are always good for a giggle.
Not to say that your point is not a good one, but the way you put it is just plain hilarious. I'm sure some of the people you chastise do not appreciate it, but keep up the good work. -Steven __________________ CHISWICK! FRESH HORSES!! –King Richard, Black Adder |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > what does this do ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|