LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-02-2005, 11:49 PM   #1
millionknives
Member
 
Registered: Jul 2004
Location: Port Charlotte Florida
Distribution: slack 12.1
Posts: 78

Rep: Reputation: 15
auto running a script from command line


Ok so I know about autorun when in kde but I'd like a script to auto run while on the command line after logging in (I use runlevel 3) but, I can't seem to find anything on how this works and most likely I'm just missing it and not noticing so if anyones got any ideas do share as this would help make life a lot easier for me!

Thanks,
Knives
 
Old 10-02-2005, 11:53 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
I'd like a script to auto run while on the command line after logging in
Is it a big script or just a couple commands? If the latter, you might like to simply append it to your ~/.profile file.
 
Old 10-03-2005, 12:11 AM   #3
millionknives
Member
 
Registered: Jul 2004
Location: Port Charlotte Florida
Distribution: slack 12.1
Posts: 78

Original Poster
Rep: Reputation: 15
To be brutely honest I've never used the ~/.profile before sure I remember reading quite a while ago on how to make one and that its useful so I do it but never gave it much thought so I'll give that a go as its rather small and not to big.
 
Old 10-03-2005, 09:46 AM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
You can just use something like
Code:
echo 'command_here' >> ~/.profile
for each command, in the order you'd like them to execute.

Or you can edit the ~/.profile file using vi or another text editor.
 
Old 10-03-2005, 03:39 PM   #5
millionknives
Member
 
Registered: Jul 2004
Location: Port Charlotte Florida
Distribution: slack 12.1
Posts: 78

Original Poster
Rep: Reputation: 15
Alright thanks and to verify this will do these in the order the commands are put in and the following will wait for the previous to complete before continueing correct?
 
Old 10-03-2005, 06:35 PM   #6
PDock
Member
 
Registered: Aug 2004
Distribution: Slack10 & curr. tried numerous
Posts: 189

Rep: Reputation: 36
The >> /.profile means add the prior command to the end of the /.profile file. To start over use command > /.profile. As to if prior command finishes first the use of sleep 3[4,5] >> /.profile ( pick one number only) should ensure completion of prior command prior to execution of hte next.

ppd
 
Old 10-03-2005, 06:41 PM   #7
uopjohnson
Member
 
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159

Rep: Reputation: 30
you can also put script into /etc/profile.d/ and then they will run everytime anyone logs in (I think)
 
Old 10-03-2005, 10:07 PM   #8
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Alright thanks and to verify this will do these in the order the commands are put in and the following will wait for the previous to complete before continueing correct?
Correct. When you're done you can always view the file with
Code:
less ~/.profile
to make sure you've added them correctly.
 
  


Reply


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
Running MPlayer from the GUI, not the command line... xbill311x Linux - Software 14 03-28-2005 09:08 PM
Running Programs from command line sumguy231 Linux - Software 4 12-17-2004 03:10 PM
auto running command.... / what have i done :| Gear_freak2000 Linux - General 13 06-12-2003 03:47 PM
Running programs from Command Line SirLostalot Linux - Newbie 1 11-11-2002 09:24 PM
Running .sh files from the command line zulu1_hl Linux - Newbie 3 11-01-2002 12:05 PM


All times are GMT -5. The time now is 03:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration