Download your favorite Linux distribution at LQ ISO.
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, 01: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, 01:58 PM   #2
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,192

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
.bash_profile (alternately, .bashrc) in your $HOME directory.
Old 01-24-2006, 06: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, 05: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 05:34 PM.
Old 01-26-2006, 08: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, 10:05 PM   #6
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
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 03:28 PM
how to run one bash script from within another? babag Programming 9 04-28-2005 12:12 AM
bash login script bunnyknight13 Linux - Newbie 4 09-10-2004 08:02 PM
bash login script seanatis Programming 6 09-06-2004 08:00 AM
Run script at login instead of bash uzi4u Linux - General 2 04-28-2004 02:31 PM > Forums > Linux Forums > Linux - General

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