Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

setting  enviroment viriables

Posted on 1998-09-27
4
Medium Priority
?
309 Views
Last Modified: 2013-12-06
After i login into my linux account,the default shell is bash, how can i set the default to tcsh.Also I check the my home directory,there is no .cshrc or .login files. I don't know in which files my PATH variable is set. In /etc/csh.login file, the PATH which is set is different from what displys on the screen when I type "echo $PATH".  
0
Comment
Question by:tian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
dhm earned 200 total points
ID: 2007086
You can use the chsh (change shell) command to change your default login shell.  Try "man chsh" to find out more, or "chsh -l" to see a list of the shells you can switch to.

Environment variables are typically set in your .cshrc/.bashrc/.profile/etc file.  If you don't have one, then you get some defaults that are either set on a system-wide level through a file like "/etc/profile", "/etc/bashrc", "/etc/csh.cshrc", or on a compile-time basis.  You may be able to change the former, although it's not a great idea; the latter is somewhat harder to change.

I think bash reads /etc/profile and/or /etc/bashrc; that's probably where you're getting your PATH if you don't have your own .profile or .bashrc.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007087
It's just a bit more complicated.

About PATH:

  in csh, tcsh you may set it in any of the configuration files
  (/etc/csh.cshrc ~/.cshrc ~/.login etc.) as follows

      setenv PATH "${PATH}:/you/path:/and/more/pathes"

  is the same as

      set path = ($path /you/path /and/more/pathes)


And about the configuration files, some hints
(unfortunately E-E may destroy the formating tabs and blanks):

#?      Some  schemas, depending on shell and operating system,
#?      in order they
#?      are called. A  -  below indicates that it is only called
#?      at login:
#?
#?          bash
#?          --------
#?              Linux:
#?                      -1) /etc/profile
#?                      -2) if ~/.bash_profile exists, source it
#?                          else if ~/.bash_login exists, source it
#?                               else if ~/.profile exists, source it
#?                       3) ~/.bashrc
#?
#?          csh
#?          --------
#?              AIX:
#?                      -1) /etc/csh.cshrc
#?                      -2) /etc/csh.login
#?                       3) ~/.cshrc
#?                      -4) ~/.login
#?              HP-UX:
#?                      -1) /etc/src.csh
#?                      -2) /etc/csh.cshrc
#?                      -3) /etc/csh.login
#?                       4) ~/.cshrc
#?                      -5) ~/.login
#?              IRIX:
#?                      -1) /etc/cshrc
#?                      -2) /etc/csh.login
#?                       3) ~/.cshrc
#?                      -4) ~/.login
#?
#?          ksh, sh
#?          --------
#?              AIX:
#?                      -1) /etc/profile
#?                      -2) ~/.profile
#?              HP-UX:
#?                      -1) /etc/src.sh
#?                      -2) /etc/profile
#?                      -3) ~/.profile
#?              IRIX:
#?                      -1) /etc/profile
#?                      -2) ~/.profile
#?
#?          tsh
#?          --------
#?              AIX:
#?                      -1) /etc/tsh_profile
#?                      -2) ~/.profile
#?
#?          tcsh
#?          --------
#?              Linux (if compiled traditionally):
#?                       1) /etc/csh.cshrc
#?                      -2) /etc/csh.login
#?                       3) if ~/.tcshrc exists, source it
#?                          else ~/.cshrc exists, source it
#?                      -4) ~/.history
#?                      -5) ~/.login
#?                      -6) ~/.cshdirs
#?              Linux (if compiled as special version):
#?                      -1) /etc/csh.login
#?                       2) /etc/csh.cshrc
#?                      -3) ~/.login
#?                       4) if ~/.tcshrc exists, source it
#?                          else ~/.cshrc exists, source it
#?                      -5) ~/.history
#?                      -6) ~/.cshdirs
#?
#?          zcsh
#?          --------
#?              Linux:
#?                        1) /etc/zshenv
#?                        2) ~/.zshenv
#?                       -3) /etc/zprofile
#?                       -4) ~/.zprofile
#?                        5) /etc/zshrc
#?                        6) ~/.zshrc
#?                       -7) /etc/zlogin
#?                       -8) ~/.zlogin

0
 

Author Comment

by:tian
ID: 2007088
Thanks ahoffmann!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007089
Hmm, dhm's answer was accepted, so I gave just a lot of hints ;-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question