Visit Jeremy's Blog.
Go Back > Forums > Other *NIX Forums > *BSD
User Name
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.


  Search this Thread
Old 04-01-2009, 08:20 PM   #1
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
openbsd 4.5 - changing .profile - logout and log back in (ssh)

every time I make changes to .profile, i need to logout and log back in to get the changes to take effect. is there any way to avoid this?

Old 04-01-2009, 09:25 PM   #2
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Usually you can integrate changes into your current shell by doing `source .profile` but some things may only take effect on shell startup. In that case perhaps you could try `exec /path/to/shell`? Not sure.
Old 04-01-2009, 09:32 PM   #3
Senior Member
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Unfortunately, "source .profile" only works for Bourne Shell and Bourne-Again Shell, not KornShell...assuming the user account you are SSH-ing to has KornShell (ksh) set as their default shell.

Last edited by indienick; 04-01-2009 at 09:34 PM.
Old 04-01-2009, 10:15 PM   #4
Registered: Mar 2007
Distribution: OpenBSD-CURRENT
Posts: 485
Blog Entries: 160

Rep: Reputation: 74
Originally Posted by noir911 View Post
every time I make changes to .profile, i need to logout and log back in to get the changes to take effect. is there any way to avoid this?


su - <your_user_name>

Old 04-02-2009, 12:00 AM   #5
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
Here is what I found: the source command is not present in openbsd 4.5-current base installation. so that definitely doesn't work. typing exec `which ksh` also didn't work. su - <username> does work but, it spawns a new shell (bad thing) and also if I have to type su - <username>, I would rather ^d and ssh back again (less typing, I guess).

Anyone else know any other trick?

O.S is OpenBSD 4.5-current with base installation with ksh & I'm connected via ssh.

Old 04-02-2009, 05:38 AM   #6
LQ Newbie
Registered: Apr 2009
Posts: 3

Rep: Reputation: Disabled

From the OpenBSD FAQ:

With ksh(1), this is more noticeable because there is only one startup script, .profile. This file is ignored unless the shell is a login shell.)
Check the faq8.html#ksh for more.
Old 04-02-2009, 07:07 AM   #7
Registered: Oct 2008
Location: Brisbane Australia
Distribution: Fedora, Centos
Posts: 276

Rep: Reputation: 54
Have you tried ". .profile" in a shell? I haven't used ksh for a while now, but I think this should work.


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
user profile not being saved after logout bradleyjr Linux - Newbie 1 01-25-2009 05:12 PM
'logout' inserted in profile cryo70 Linux - Security 6 09-19-2005 06:01 PM
howto re-load my ~/.profile without logout? minike Slackware 4 09-18-2005 01:36 AM
Cant log out of window manager and log back into kde randrake Linux - General 4 08-11-2005 12:01 PM
bash logout profile rc cs emacs sreenrc ravenarts Linux - Newbie 2 05-15-2002 09:01 PM > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 10:31 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