LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2010, 11:56 AM   #16
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978

Quote:
Originally Posted by deepti_114 View Post
When i do: "ls -al $HOME/.tcshrc" - it says no such file.But its not at $HOME that is my working directory.
I think this is the problem. Whatever your working directory is, the shell looks for configuration files in the user's HOME directory. If you need to have these environment variables set at each login, you should stick with the $HOME/.tcshrc file.

Regarding the not-working script, take in mind that if you execute a script, all its variables have a local scope and the environment defined with setenv is available only to its childs. Once the script exits, all its variable are lost (be they assigned using set or setenv). Instead you have to source the script if you want the environment be retained permanently in the current shell:
Code:
source myscript.sh
Sourcing a file means to execute every line as if you write it in the current shell. Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Set permanently Package configuration variables vofka Linux - General 1 07-05-2009 07:32 PM
Permanently Set Environment Variable LANG Mistro116@yahoo.com Red Hat 1 06-12-2008 09:11 PM
howto set system-wide environment variables permanently in debian vineet7kumar Linux - Newbie 2 05-08-2008 07:39 PM
How to set up an system wide environment variable permanently?? piyush.kansal Fedora 5 12-07-2007 05:04 AM
Help with the currently set environment variables!! apoc013 Linux - Newbie 6 01-21-2004 02:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration