Solved

setting  enviroment viriables

Posted on 1998-09-27
4
306 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 50 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

732 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