UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old June 23rd, 2004, 05:37 AM
w_jones w_jones is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 2 w_jones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old June 23rd, 2004, 05:55 AM
stevengs stevengs is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Germany
Posts: 394 stevengs User rank is Lance Corporal (50 - 100 Reputation Level)stevengs User rank is Lance Corporal (50 - 100 Reputation Level)stevengs User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 4 h 36 m 24 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
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

Reply With Quote
  #3  
Old June 23rd, 2004, 06:24 AM
w_jones w_jones is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 2 w_jones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
so nothing then

so in the contex of the the script itself - NOTHING ??

Thats what I thought and so why I asked

Reply With Quote
  #4  
Old June 23rd, 2004, 09:35 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
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

Reply With Quote
  #5  
Old June 23rd, 2004, 10:22 AM
stevengs stevengs is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Germany
Posts: 394 stevengs User rank is Lance Corporal (50 - 100 Reputation Level)stevengs User rank is Lance Corporal (50 - 100 Reputation Level)stevengs User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 4 h 36 m 24 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
so in the contex of the the script itself - NOTHING ??


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

Reply With Quote
  #6  
Old June 23rd, 2004, 11:12 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
w_jones, start here and learn how to post a descriptive subject title. Then go here and see why it matters that much.

Reply With Quote
  #7  
Old June 23rd, 2004, 11:16 AM
stevengs stevengs is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Germany
Posts: 394 stevengs User rank is Lance Corporal (50 - 100 Reputation Level)stevengs User rank is Lance Corporal (50 - 100 Reputation Level)stevengs User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 3 Days 4 h 36 m 24 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > what does this do ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway