Solved

setting  enviroment viriables

Posted on 1998-09-27
4
305 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

807 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