The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Export command prakash.kudreka UNIX for Advanced & Expert Users 3 11-20-2007 08:37 AM
export equivalent command in PERL ammu Shell Programming and Scripting 1 09-17-2007 03:46 PM
typeset and export command difference systemsb UNIX for Dummies Questions & Answers 0 05-16-2006 11:36 AM
UNIX export command - memory space Nomaad UNIX for Advanced & Expert Users 2 04-10-2006 08:49 PM
export command radhika03 UNIX for Dummies Questions & Answers 2 12-16-2005 09:25 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-01-2005
sveera sveera is offline
Registered User
  
 

Join Date: Mar 2005
Location: INDIA
Posts: 60
Wink using export command

I saw a unix shell script in which export command is used like this :
export filename
what is a file exported for ?

thanks
srini
  #2 (permalink)  
Old 04-01-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Actually, the way to think of it is that variables are exported. And a variable gets exported to the environment. This means that child processes will be able to access it. The PATH variable was exported for you. View it with:
echo $PATH
You may have commands like env or printenv that can display the entire environment.
  #3 (permalink)  
Old 04-01-2005
sveera sveera is offline
Registered User
  
 

Join Date: Mar 2005
Location: INDIA
Posts: 60
Hi Perderabo,
Thanks for your reply.But in that script i see that they have used it to export a filename....I agree that export is used so that the child shell can also have access to the variables.And i also agree what u said about the path varible being exported.And i see that the file name is either a actual filename or a directory path.
So what is the reason to do this ?
Thanks in advance
sveera
  #4 (permalink)  
Old 04-01-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
I command like "export filename" defines a variable called "filename" and sets the export flag. This would only be useful if a
filename=something
statement followed or preceded.

This assumes ksh or bash. And it assumes that "export" was not redefined. It's possible that the author of the script made an error.
  #5 (permalink)  
Old 04-01-2005
sveera sveera is offline
Registered User
  
 

Join Date: Mar 2005
Location: INDIA
Posts: 60
Talking

Thank you Perderabo.
bye
sveera
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0