Ksh .profile not read on login under Gnome desktop
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.