LinuxQuestions.org
Visit Jeremy's Blog.
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 07-09-2006, 02:12 PM   #1
jake2
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Rep: Reputation: 0
Background job output


hi all,

I modified the /etc/profile to run a program when every users login a linux box. because this program seem takes a little long to execute, I send it to the background while it is running. I add the following line in the "/etc/profile" file.

. myprogram >/dev/null &

When the job finishes, I see a message like this:

[1] + Done . myprogram >/dev/null

print out on the shell prompt.

Is anyone can help or give some hints to stop this message print out on user' shell prompt? Appreciate any helpful info.

Thank you very much.

jake2
 
Old 07-09-2006, 03:26 PM   #2
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
Well, since there isn't a reply yet, I do have a quick hack that will get around this issue. I'm afraid it's the best I know how to do, though:

Code:
/usr/bin/screen -d -m /path/to/myprogram
If you don't know about screen, it is a very handy program which becomes the output console for the program. You can pull it up later (while the program is running) for the output... or in this case, not. the two switches "-d -m" mean to start the program and immediately disassociate itself from the current console. When "myprogram" finishes, screen will close without any messages to the user. It will use a tiny bit more memory since you will be launching two programs, but on most systems made in the last few years it isn't enough to worry about.
 
Old 07-09-2006, 09:32 PM   #3
jake2
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Daga, I really appreciate your respond. I am currently running RHRL which doesn't have /usr/bin/screen installed by default. I will be happy to get another work around from any of you. Thank you.

jake2
 
Old 07-09-2006, 10:05 PM   #4
jake2
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Daga, Thank you very much. "screen" works great after I tried it out.
 
Old 07-09-2006, 10:46 PM   #5
truthfatal
Member
 
Registered: Mar 2005
Location: Winnipeg, MB
Distribution: Raspbian, Debian, Slackware, OS X
Posts: 443
Blog Entries: 9

Rep: Reputation: 32
wouldn't
Code:
someprog > /dev/null 2>&1
work?
 
Old 07-09-2006, 10:54 PM   #6
jake2
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
truthfatal, I already try out that. I doesn't work for me. Anyway, Thank you for your respond.
 
Old 07-09-2006, 11:37 PM   #7
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
Quote:
Originally Posted by jake2
Daga, Thank you very much. "screen" works great after I tried it out.
Glad it does what you need
 
  


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
Regaining output from a background process the_holysmoke Linux - Newbie 4 03-11-2011 07:48 PM
changing variables from background job bobwall Programming 2 06-18-2005 03:28 PM
Sending a job straight to background detly Linux - General 4 02-02-2005 03:51 AM
Problem displaying program output when driven by a cron job garmon Linux - Newbie 1 07-22-2004 03:34 PM
how to stop background job jax8 Linux - Newbie 6 02-17-2004 01:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration