DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th September 2008
kasse kasse is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 67
Default when and by what is .profile read?

Hello, I seem to have trouble that my .profile is not read when I log in using slim. I assume this since none of the paths in .profile are exported.
I know that ~/.xinitrc is read according to slim.conf, but that only runs startxfce4 at my computer. Should I add ~/.profile as another command line to be executed at login in slim.conf?
Also there are problems with certain of the arrow keys etc in the xterms, e.g I cannot scroll back to previous commands or use the tab for completion.
Reply With Quote
  #2   (View Single Post)  
Old 8th September 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

~/.profile is executed when said user has a Bourne shell (sh or bash). I'm not sure if any other shells use it.

See sh(1) for more precise details.
__________________
Kill your t.v.
Reply With Quote
  #3   (View Single Post)  
Old 8th September 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

The C shell (i.e. tcsh, the default FreeBSD shell) doesn't use it, it uses ~/.cshrc and ~/.login ... See ``FILES'' section of tcsh(1) and the ``Invocation'' section if sh(1) (Use / key to search).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #4   (View Single Post)  
Old 8th September 2008
kasse kasse is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 67
Default

That is strange since when I click on the terminal I assume that it starts sh since it has the $ prompt and export command works, so it is not csh. But it still does not read in the paths in ~/.profile or ~/.shrc, even when I explicitly run sh.
Reply With Quote
  #5   (View Single Post)  
Old 8th September 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

% echo $SHELL

Also, read those manpages. It tells you exactly when (and under what conditions) ~/.profile is executed.
__________________
Kill your t.v.
Reply With Quote
  #6   (View Single Post)  
Old 9th September 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Start an xterminal with
Code:
$ xterm -ls &
From the xterm man page
Code:
       -ls     This  option  indicates  that  the  shell  that is
               started in the xterm window will be a login  shell
               (i.e.,  the  first  character of argv[0] will be a
               dash, indicating to the shell that it should  read
               the user's .login or .profile).
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #7   (View Single Post)  
Old 9th September 2008
kasse kasse is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 67
Default

Thanks J65nko, that's a long man file but as I skimmed it I saw the backspace/delete problem.

I was also wondering why there were settings of PATH in both .profile and .sh, since I guess that .sh executed for every shell not just login shells?

Is there a way to search in the manfiles when you have executed the man command? for me it works to use / to search for plain text but not things like .profile or -ls.

To set all the command line options (like color etc) for xterm can there be a .xterm file or do you have to execute a file with the xterm command followed by all the options?

Any how now that I checked what the menu actually ran exo-open --launch TerminalEmulator, so it was not xterm after all. so I gues I will change that menu button now.
Reply With Quote
  #8   (View Single Post)  
Old 10th September 2008
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

The man page viewer can be customized by setting the PAGER environment variable. I use the less program.
Code:
export PAGER=less
With less I have no problem searching the xterm man for -ls.

Looking for .sh is trickier, because the".' (period) has a special meaning in the regular expression mini-language used for searching. From man re_format:
Code:
     .       Matches any single character that is not a newline (`\n').
To tell the search function to use a literal "." when searching for .profile you have to escape the period with a backslash;
Code:
\.sh
. So your search now becomes: /\.sh.

I am not really a desktop person, and don't have a FBSD desktop available right now, but on my OpenBSD box has the following in the ~/.Xresources file:
Code:
j65nko@hercules[~]cat .Xresources               
XTerm*loginShell: true
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #9   (View Single Post)  
Old 11th September 2008
kasse kasse is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 67
Default

I appreciate it, your replies really set the standard .

I hope that these newbie questions do not create too much noise on this forum. Perhaps you could have a own section for these kind of questions, so that people who are "serious" are not annoyed.
I guess one could always search more on the web and go through books and man-files. But if the OS per se is not the center of ones universe, it is hard to put that much effort into resolving these problems on your own. Therefore until the data-base of posts on this forum is not so big that you can find most answers by searching the posts here, I hope that this is ok, Of course the person asking questions should not come and expect to get served with answers, but instead be grateful for any help that he/she gets.
But that is just my opinion, perhaps the BSD systems is not an alternative for regular lazy windows users.

Last edited by kasse; 11th September 2008 at 08:58 AM.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I edit my .profile to permanently have an ftp site to point to badguy OpenBSD Packages and Ports 12 19th July 2009 02:05 AM
working with .profile and history uptonm OpenBSD Security 1 15th August 2008 12:14 PM
Profile option to display system used JMJ_coder Feedback and Suggestions 4 23rd June 2008 06:12 PM
Firefox profile not saving tonywob FreeBSD General 4 20th May 2008 12:20 PM


All times are GMT. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick