Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

.login and .cshrc questions

 
   Linux (Home) -> SUSE RSS
Next:  Accepted binutils 2.19.91.20090923-1 (source all ..  
Author Message
mike

External


Since: Mar 25, 2008
Posts: 2



(Msg. 1) Posted: Wed Sep 23, 2009 4:41 am
Post subject: .login and .cshrc questions
Archived from groups: alt>os>linux>suse (more info?)

Hi,

I have two questions:

1. How do I differ in what I put in my .login and .cshrc files?
AFAIK .login is called when I login to my system once and .cshrc is
called each time I open a new shell window. Right? Do you have any
examples?

2. I need a deamon to be started at login. But before starting it I
need to provide my password to it. How can I accomplish this so I will
not forget? Today I have to start the deamon each time I reboot ( easy
to forget).


br,

//mike
Back to top
Login to vote
Eef Hartman

External


Since: Jul 23, 2009
Posts: 15



(Msg. 2) Posted: Wed Sep 23, 2009 9:25 am
Post subject: Re: .login and .cshrc questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

mike wrote:
> How do I differ in what I put in my .login and .cshrc files?
> AFAIK .login is called when I login to my system once and .cshrc is
> called each time I open a new shell window. Right? Do you have any
> examples?

Essentially, .cshrc is for things you will need in ALL open shells,
windows (Terminal/konsole etc). Normally all of your aliases and
environment setting go in there.
The .login file is ONLY for things you want in a login shell
(like notification of quota, special settings) and is often (almost)
empty. You don't have to duplicate (UNlike bash) anything which is
already in the .cshrc as a C-shell first sources .cshrc and then,
only when it IS a login shell, does the .login (and when it exits,
the .logout) script.
Starting specific daemons for the user session thus is a task for .login.

This is my .login
alias bye 'clear;logout'
if ( $OSTYPE == linux ) then
alias x 'startx >>& ~/.startx.log'
biff n
if ( -x /usr/games/fortune ) /usr/games/fortune
else
if ( -x /usr/local/tabin/fortune ) fortune
endif
(which contains left-overs from the time I used the same home dir for
Linux _and_ for HP-UX unix, that's why the if is there).
Our installation had fortune cookies DISabled, but I like them,
so at login I try to run that program.
And the alias "bye" uses logout, which is a command only supported
by a login shell.

My .cshrc file - on the other hand - is very long and complicated -
I'm not going to show that here.
--
Eef Hartman, Delft University of Technology, dept. SSC/ICT
Back to top
Login to vote
Unruh

External


Since: Mar 29, 2005
Posts: 545



(Msg. 3) Posted: Wed Sep 23, 2009 7:25 pm
Post subject: Re: .login and .cshrc questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

mike <mikaelpetterson RemoveThis @hotmail.com> writes:

>Hi,

>I have two questions:

>1. How do I differ in what I put in my .login and .cshrc files?
>AFAIK .login is called when I login to my system once and .cshrc is
>called each time I open a new shell window. Right? Do you have any
>examples?

>2. I need a deamon to be started at login. But before starting it I
>need to provide my password to it. How can I accomplish this so I will
>not forget? Today I have to start the deamon each time I reboot ( easy
>to forget).

You already provided your password to log in. Why provide it again to
run the daemon?


>br,

>//mike
Back to top
Login to vote
Unruh

External


Since: Mar 29, 2005
Posts: 545



(Msg. 4) Posted: Wed Sep 23, 2009 7:25 pm
Post subject: Re: .login and .cshrc questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Eef Hartman <E.J.M.Hartman.DeleteThis@tudelft.nl> writes:

>mike wrote:
>> How do I differ in what I put in my .login and .cshrc files?
>> AFAIK .login is called when I login to my system once and .cshrc is
>> called each time I open a new shell window. Right? Do you have any
>> examples?

>Essentially, .cshrc is for things you will need in ALL open shells,
>windows (Terminal/konsole etc). Normally all of your aliases and
>environment setting go in there.
>The .login file is ONLY for things you want in a login shell
>(like notification of quota, special settings) and is often (almost)
>empty. You don't have to duplicate (UNlike bash) anything which is

source .bashrc
in the .bash_profile
Was that so hard.
And that allows you to decide if .bashrc is run first, last or inbetween.

>already in the .cshrc as a C-shell first sources .cshrc and then,
>only when it IS a login shell, does the .login (and when it exits,
>the .logout) script.
>Starting specific daemons for the user session thus is a task for .login.

>This is my .login
>alias bye 'clear;logout'
>if ( $OSTYPE == linux ) then
> alias x 'startx >>& ~/.startx.log'
> biff n
> if ( -x /usr/games/fortune ) /usr/games/fortune
>else
> if ( -x /usr/local/tabin/fortune ) fortune
>endif
>(which contains left-overs from the time I used the same home dir for
>Linux _and_ for HP-UX unix, that's why the if is there).
>Our installation had fortune cookies DISabled, but I like them,
>so at login I try to run that program.
>And the alias "bye" uses logout, which is a command only supported
>by a login shell.

>My .cshrc file - on the other hand - is very long and complicated -
>I'm not going to show that here.
>--
>Eef Hartman, Delft University of Technology, dept. SSC/ICT
Back to top
Login to vote
Eef Hartman

External


Since: Jul 23, 2009
Posts: 15



(Msg. 5) Posted: Thu Sep 24, 2009 6:25 am
Post subject: Re: .login and .cshrc questions [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Unruh wrote:
> source .bashrc
> in the .bash_profile
> Was that so hard.
> And that allows you to decide if .bashrc is run first, last or inbetween.

Actually, in openSUSE, /etc/profile already does this for you:
if test "$is" = "bash" -a -z "$_HOMEBASHRC" ; then
# loop detection
readonly _HOMEBASHRC=true
test -r $HOME/.bashrc && . $HOME/.bashrc
fi
(the variable _HOMEBASHRC is to prevent it being run twice),
so - in openSUSE - you don't have to include the above "source" command
in your own profile.

I was talking generic bash, not all users will know about this openSUSE
modification to make bash behave like csh
--
Eef Hartman, Delft University of Technology, dept. SSC/ICT
Back to top
Login to vote
Display posts from previous:   
Related Topics:
KDE login screen questions - I'm trying to get my DPMS working at the KDE login screen. Monitor won't go into standby at KDE login screen (it does blank out though). When logged in as any of my users, standby for monitor works fine. Any ideas on getting monitor standby working fo...

Login Problems - Good Morning, I am having a problem logging in to my normal user mode on Suse 9.1. I can log into root with no problem, I have created a new user & it works fine. The problem occurs at the splash screen as it it listing all the processes...

adding paths after login - I'm trying to add a LD_LIBRARY_PATH after a user logs in..where would I add my export LD_LIBRARY_PATH command?

GRUB login bitmap - Would anyone know where this can be found? Meaning, the graphic that is used as a background image for when the GRUB menu first comes up on boot. I'd like to change the one that's used by default for another one. Cheers, John B.

Login with wrong password possible - Hello everybody, i just setup an SLES 9 Server connected to an LDAP Server and have the following problem: I can login with every user from ldap with a wrong password. It doesn't matter with i login via shell, X or ssh. Therefor i think it's an pam..
       Linux (Home) -> SUSE All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
  Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact