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
environment variables sumsin High Level Programming 6 03-13-2006 11:17 AM
help..Environment variables... sekar sundaram UNIX for Dummies Questions & Answers 3 08-30-2005 03:35 AM
environment variables spavlov UNIX for Dummies Questions & Answers 3 08-20-2003 09:49 AM
environment variables Esaia High Level Programming 2 02-20-2003 08:19 PM
what is the use of Environment variables indianguru UNIX for Dummies Questions & Answers 2 07-24-2001 09:41 PM

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

Join Date: Aug 2005
Posts: 18
environment variables

Hi,

If i have a variable set and exported in my pofile file will that variable be available in all shell scripts created.

Thanks,
Radhika.
  #2 (permalink)  
Old 01-17-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
In all shell scripts created? No.
Shell variables have significance only at runtime. If you run any of the scripts from your id, then the variable will be set. If you run it from any other id that does not set the variable, then the value will not be set.
Just because the variable value was set when the shell script was created does not mean that it will be set at runtime.
  #3 (permalink)  
Old 01-22-2007
pankajbraval pankajbraval is offline
Registered User
  
 

Join Date: Jan 2007
Location: India-Gujarat-Jamnagar
Posts: 44
export variable

dear

when you define variable in profile and you want to export for all user
then your all user path set for a specific directory say in root </usr1>
and now you set profile in this with export variable now all user can take
variable which defined in /usr1 .profile.

pankajbraval
pankajbraval@sify.com
  #4 (permalink)  
Old 01-22-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
The proper way to make a scrpt is to make sure it does NOT depend on settings done in a profile or whatever. Do not depend on "lucky" circumstances.

You make sure that all settings required by the script are done within the script. The script should be independant of settings elsewhere. This way you are also sure it will run as a cron job.
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 10:46 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