LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: Disabled
Xterm


When we open xterm, how does it know which shell to start..
 
Old 02-13-2015, 05:36 PM   #2
Head_on_a_Stick
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, 08:54 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
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:
Code:
...
       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.
...
 
  


Reply


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


All times are GMT -5. The time now is 06:27 PM.

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