Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-13-2015, 04:18 PM   #1
LQ Newbie
Registered: Feb 2015
Posts: 11

Rep: Reputation: Disabled

When we open xterm, how does it know which shell to start..
Old 02-13-2015, 04:36 PM   #2
Senior Member
Registered: Dec 2014
Location: London, England
Distribution: Arch & Debian
Posts: 1,183

Rep: Reputation: 283Reputation: 283Reputation: 283
It parses the $SHELL variable.

This is stored in /etc/passwd
Old 02-13-2015, 07:54 PM   #3
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,706

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
Originally Posted by Head_on_a_Stick View Post
It parses the $SHELL variable.

This is stored in /etc/passwd
Actualy the SHELL variable is in the parent process. The initial value does come from /etc/passwd (or LDAP/NIS/... whatever you use for network authorization) on login.

You can change the shell used by either changing the environment variable, or by specifying the shell on the command line.

From the man page on xterm:
       One parameter (after all options) may be given.  That overrides xterm's
       built-in choice of shell program:

       ·   If the parameter is not a relative path, i.e., beginning with  “./”
           or  “../”,  xterm looks for the file in the user's PATH.  In either
           case, this check fails if xterm cannot construct an absolute path.

       ·   If that check fails (or if no such parameter is given), xterm  next
           checks the “SHELL” variable.  If that specifies an executable file,
           xterm will attempt to  start  that.   However,  xterm  additionally
           checks if it is a valid shell, and will unset “SHELL” if it is not.

       ·   If “SHELL” is not set to an executable file, xterm tries to use the
           shell program specified in the  user's  password  file  entry.   As
           before, xterm verifies if this is a valid shell.

       ·   Finally, if the password file entry does not specify a valid shell,
           xterm uses /bin/sh.


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
Unable to set display in xterm or use any xterm related commands in Ubuntu nesi Linux - Software 1 07-19-2014 11:20 PM
Spawning xterm from Linux service: xterm: DISPLAY is not set bayoulinux Linux - General 3 11-26-2011 08:35 PM
XTerm(241) support for truetype fonts and method of changing XTerm font. ajassat Linux - Software 2 08-19-2009 12:01 PM
xterm - howto lauch an xterm into a specific directory jobano Linux - Software 8 02-26-2008 03:18 PM
how is black xterm background in IceWM when issue a xterm command? BRAHmS Linux - Software 1 02-14-2005 03:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 PM.

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