Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-24-2006, 02:53 PM   #1
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Rep: Reputation: 31
Run Bash Script @ login


I created a bash script that I run after I login to X11 (KDE); I boot to init 3 then I run startx. I was wondering if it is possible to automate the script to run after I login from the bash prompt. If this is possible, what do I have to edit to make this work?

Thanks in advance!
Old 01-24-2006, 02:58 PM   #2
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,072

Rep: Reputation: 323Reputation: 323Reputation: 323Reputation: 323
.bash_profile (alternately, .bashrc) in your $HOME directory.
Old 01-24-2006, 07:33 PM   #3
Senior Member
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
.bash_profile will execute only at login, .bashrc executes everytime you start a shell
Old 01-26-2006, 06:32 PM   #4
Registered: Apr 2003
Location: Juneau, Alaska
Posts: 247

Rep: Reputation: 31
You might want to try adding your script to .xinitrc if you only want it to run when you "startx".

Last edited by camelrider; 01-26-2006 at 06:34 PM.
Old 01-26-2006, 09:46 PM   #5
Registered: Dec 2004
Distribution: RHEL, CentOS, SuSE
Posts: 170

Original Poster
Rep: Reputation: 31
thanks for ALL your help!
Old 01-26-2006, 11:05 PM   #6
LQ Guru
Registered: Jan 2001
Posts: 24,147

Rep: Reputation: 229Reputation: 229Reputation: 229
Your all wrong, use .bash_login in your users home directory to run bash scripts upon login..


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run my bash script as a daemon. jaimese Linux - Newbie 12 02-10-2011 04:28 PM
how to run one bash script from within another? babag Programming 9 04-28-2005 01:12 AM
bash login script bunnyknight13 Linux - Newbie 4 09-10-2004 09:02 PM
bash login script seanatis Programming 6 09-06-2004 09:00 AM
Run script at login instead of bash uzi4u Linux - General 2 04-28-2004 03:31 PM

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