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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
12-14-2009, 05:18 PM
|
#1
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Rep:
|
CentOS - run local profile at login
Hello all. Solaris user here trying to learn some Linux. CentOS in this case.
I have created a .profile file in my home directory to do things such as set: the path, a prompt, backspace as delete, etc.
When I login, the .profile file does not run. However when I execute it manually using . ./.profile it works just fine.
I checked the User Manager (?) and could not find where you set the file to use for local settings. If you wanted to use one at all that is.
I am using CentOS 5.3 and the Korn shell.
So my question: how does a person run a local profile file from their home directory during login? Or is there some other way of doing this using CentOS?
Thanks!
~Robert
|
|
|
12-14-2009, 05:21 PM
|
#2
|
Member
Registered: Jun 2007
Posts: 152
Rep:
|
|
|
|
12-14-2009, 05:25 PM
|
#3
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by RobertSubnet
Hello all. Solaris user here trying to learn some Linux. CentOS in this case.
I have created a .profile file in my home directory to do things such as set: the path, a prompt, backspace as delete, etc.
When I login, the .profile file does not run. However when I execute it manually using . ./.profile it works just fine.
I checked the User Manager (?) and could not find where you set the file to use for local settings. If you wanted to use one at all that is.
I am using CentOS 5.3 and the Korn shell.
So my question: how does a person run a local profile file from their home directory during login? Or is there some other way of doing this using CentOS?
Thanks!
~Robert
|
I know this may be a silly question, but why bother with
Korn if you want to actually use Linux? Just use bash,
the default for the OS, and the weapon of choice for the
init scripts it uses.
Cheers,
Tink
P.S.: At least you weren't asking about csh ;}
|
|
|
12-14-2009, 05:50 PM
|
#4
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Original Poster
Rep:
|
Quote:
I know this may be a silly question, but why bother with
Korn if you want to actually use Linux? Just use bash,
the default for the OS, and the weapon of choice for the
init scripts it uses.
|
I guess I do not know enough about Linux to understand why Korn is not Linux.
|
|
|
12-14-2009, 06:59 PM
|
#5
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415
|
When Linux was first written, ksh (ksh88 ?) was still a closed src program, so they went with bash; highly ksh compatible (work-alike), but open src & free.
You could get pdksh (public domain ksh rewrite) but it wasn't that popular for obvious reasons.
Later on, ksh (ksh93 iirc) became open, but by that pt the default was bash.
Your choice as to which you use, but getting used to bash is prob a good idea. As I say, the 2 are very close in functionality. The main problem in porting scripts is external cmds/progs like find, which the GNU team have extended with extra options and in some cases altered. See the -maxdepth/-prune options between old school find and the gnu version.
HTH
Bash docs:
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
PS: I've happily used both (worked on Linux/Solaris/HP-UX), but usually go with whatever my prod systems happen to be using; less confusing.
|
|
|
12-14-2009, 07:19 PM
|
#6
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Original Poster
Rep:
|
Thanks guys for your replies. At work at the moment so don't have too much free time to digest all the replies. But I did want to write a quick thank you for the thoughtful answers!
~Robert
|
|
|
12-15-2009, 03:46 PM
|
#7
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Original Poster
Rep:
|
Thanks again for the replies.
My problem is not writing a .profile or understanding the commands in a .profile, it is getting the thing to run at login.
My .profile file works, it just doesn't run at login.
So with CentOS 5.3 does anyone know how to get a .profile file to run at login? The file is located in the home directory.
Thanks!
|
|
|
12-15-2009, 05:06 PM
|
#8
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
What does the line in /etc/passwd for your user ID look like?
Which package is your ksh from?
Cheers,
Tink
|
|
|
12-15-2009, 05:21 PM
|
#9
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Original Poster
Rep:
|
Tink:
It will be a couple of hours until I get home and can answer your question regarding /etc/passwd
My OS is CentOS 5.3. Not sure if that answers your question about which package ksh is from.
~Robert
|
|
|
12-15-2009, 05:42 PM
|
#10
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415
|
If you are using Centos, just the std install, the ksh should be the one from the repos and should work. It's possible that your login entry in /etc/passwd still says bash, not ksh.
Just FYI, as with ksh = .profile & .kshrc, the equiv files for bash are .bash_profile & .bashrc, although bash would (should ?) run .profile if no .bash_profile exists, iirc.
|
|
|
12-15-2009, 06:06 PM
|
#11
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Original Poster
Rep:
|
Is a colon
:
required at the top of the .profile script even though I am using a ksh? I am almost positive my .profile does not start with that.
|
|
|
12-15-2009, 06:23 PM
|
#12
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415
|
':' is the null statement, can't imagine you need that for anything.
What did your entry in /etc/passwd say?
What does
echo $SHELL
say?
cat /etc/shells
Last edited by chrism01; 12-15-2009 at 08:41 PM.
Reason: Tidy up
|
|
|
12-15-2009, 07:31 PM
|
#13
|
LQ Newbie
Registered: Jun 2009
Location: Phoenix, AZ
Distribution: CentOS
Posts: 11
Original Poster
Rep:
|
I am still at work. Will post those results as soon as I get home, kiss the wife and kid and can get on the box
|
|
|
All times are GMT -5. The time now is 12:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|