LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-22-2011, 07:48 AM   #1
danie1
LQ Newbie
 
Registered: Aug 2008
Posts: 10

Rep: Reputation: 0
Ksh .profile not read on login under Gnome desktop


I downloaded ksh for Debian and set up a .profile, but when I execute a terminal window under Gnome it fails to read the .profile or .kshrc. I experimented some with gnome-terminal options, but could not get it to read the files. I can execute the files manually ok. My user shell says ksh but the files are not read. Any suggestions appreciated. Thanks.
 
Old 08-22-2011, 09:33 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Did you change the shell in /etc/passwd? The password entry needs to look like
Code:
userid:x:1000:100:fname lname,,,:/home/userid:/bin/ksh
Also, you need to log out (or better yet reboot if you use graphical log in window) so things actually get read.

Just in case you're not familiar with Korn Shell, your .kshrc gets read by .profile with something similar to this
Code:
#       set up the ksh environment                                                                  
ENV=${HOME}/.kshrc                                                                                  
export ENV
Hope this helps some.
 
Old 08-23-2011, 07:23 AM   #3
danie1
LQ Newbie
 
Registered: Aug 2008
Posts: 10

Original Poster
Rep: Reputation: 0
I'm a retired admin. Used Korn for years (don't actually like bash). Yes, I did all that.

Linux 2.6.26-2-686:</home/dan[rufus]$echo $SHELL
/usr/bin/ksh
Linux 2.6.26-2-686:</home/dan[rufus]$echo $ENV
/home/dan/.kshrc
Linux 2.6.26-2-686:</home/dan[rufus]$. ./.profile

Linux 2.6.26-2-686:</home/dan>
[rufus]$grep dan /etc/passwd
dan:x:1000:1000:dan,,,:/home/dan:/usr/bin/ksh

Linux 2.6.26-2-686:</home/dan>
[rufus]$

Last edited by danie1; 08-23-2011 at 07:25 AM.
 
Old 08-24-2011, 08:52 AM   #4
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
I don't know specifically about GNOME (don't like it or BASH either, too) but here's a thought.

KDE has two terminal utilities, one, a terminal emulator (/usr/bin/terminal), does not execute ~/.profile (just give a $ prompt); the other, /usr/bin/konsole, does execute ~/.profile.

Anything like that in GNOME?

Hope this helps some.

By the way, does Debian support /etc/profile.d (with environment setup files)? Although this has nothing to do with the problem, I add a couple of files to /etc/profile.d for setting environment variables and things so I don't have to monkey with /etc/profile or my home .profile (well, except for .kshrc anyway). The one I use for Korn Shell may be of interest (assuming the existence of /etc/profile.d, that is):
Code:
cat /etc/profile.d/ksh.sh
#!/bin/sh
#ident  "$Id$"
#
#       Name:           $Source$
#       Version:        $Revision$
#       Modified:       $Date$
#       Purpose:        set local environment variables for Korn Shell
#       Author:         T. N. Ronayne
#       Date:           1 Oct 2009
#       $Log$
# Set the HOST environment variable
export HOST="`uname -n`"
# Set ksh93 visual editing mode:
if [ "$SHELL" = "/bin/ksh" ]; then
#  VISUAL=emacs         # ugh
#  VISUAL=gmacs         # double ugh
   VISUAL=vi            # ah, elegence
fi
# Set a default shell prompt:
#PS1='`hostname`:`pwd`# '
# Do these anyway in case sombody uses a different shell                                            
if [ "$SHELL" = "/bin/pdksh" ]; then                                                                
 PS1='! $ '                                                                                         
elif [ "$SHELL" = "/bin/ksh" ]; then                                                                
 PS1='${HOST}-${USER}-${PWD}: '                                                                     
elif [ "$SHELL" = "/bin/zsh" ]; then                                                                
 PS1='%n@%m:%~%# '                                                                                  
elif [ "$SHELL" = "/bin/ash" ]; then                                                                
 PS1='$ '                                                                                           
else                                                                                                
 PS1='\u@\h:\w\$ '                                                                                  
fi                                                                                                  
PS2='> '                                                                                            
export PS1 PS2
Maybe useful, maybe not.
 
Old 08-26-2011, 03:40 PM   #5
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Had a thought -- have you tried just running xterm? That ought to read /etc/profile for you.
 
Old 08-29-2011, 04:08 PM   #6
danie1
LQ Newbie
 
Registered: Aug 2008
Posts: 10

Original Poster
Rep: Reputation: 0
Actually I noticed that and *thought* I posted a comment about it a few days ago. There is not profile.d but there is an xterm. So I imported some options from a script I used to use and tried: xterm -ls -geometry 140x40 -sb -rightbar -bg gray -fg black -title "[hostname]:~dan" -iconic -n "[hostname]:~dan"

This kind of works. It may be too many options, since it won't start as iconic, but everything else seems to work. The ls option causes it to read the profile.
 
  


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
[SOLVED] Can't shutdown or restart from Gnome or the Gnome login screen. Please read. pr_deltoid *BSD 1 06-15-2010 06:32 PM
ksh: while read doesn't get to read more than one variable eantoranz Linux - Software 1 07-24-2009 03:33 PM
RHEL5 X-windows login- /etc/profile not being used by KSH users only caseybea Red Hat 0 06-03-2008 10:13 AM
Debian ksh doesn't read profile Shentar Linux - General 1 09-13-2005 05:29 PM
cannot login using GNOME desktop Pisces107 Red Hat 2 12-16-2003 02:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:21 AM.

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
Open Source Consulting | Domain Registration