Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jul 8th, 2006, 5:48 AM   #1
hush
Programmer
 
hush's Avatar
 
Join Date: Feb 2006
Location: 127.0.0.1
Posts: 35
Rep Power: 0 hush is on a distinguished road
Path=$path:

I redirected env into a file, and then altered it a little so that I could set the environmental variables when a script is executed.

I was having a problem when the script was being executed by cron.

In the end it worked out ok but I was wondering if anyone could explain each part of the command I added or has a link to a page that had some info on it. I found the command in a scripting book and then again on the web but neither of them went into any detail.

I hate using code that I don’t understand.

PATH=$PATH:/usr/local/bin
export PATH

This is what I think is happening:
The PATH=/usr/local/bin sets the variable to what ever is on the right hand side of the =

Export PATH exports the variable, as it is a global variable it is able to do this (can some one confirm this is correct)

$PATH: was on a line that followed PATH=/usr/local/bin so I assume this somhow appends the string within the variable (this is a guess and the part I am most confused by). What is the “:” all about?.

hush
hush is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:50 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC