Solved

setting  enviroment viriables

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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 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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now