LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-17-2010, 11:46 AM   #1
JustImagine
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
Inconstant Behavior on SUSE Servers Using & background command


Have a bit of a dilemma I'm trying to track down. Have a user using both date and ps commands with & at the end of the line in a shell script. When he runs the script, it waits until he hits ENTER to get back to a prompt. Other times he doesn't. Also, I've noticed that this will sometimes happen, then immediately rerun the script and the behavior stops.

Thoughts? What controls this type of behavior?

Thanks ahead of time!
 
Old 12-18-2010, 05:26 AM   #2
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Why using & at all, when the script is intended to wait? What you see is a race condition which can't be predicted, i.e. which subprocess will finish first will change from run to run.
 
  


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
[SOLVED] Problems using mktime() to calculate diff. between date on c++ (inconstant results) Lobinho Programming 4 07-28-2010 07:53 AM
Behavior of Command Line Expansion in touch command ahmedb72 Linux - Newbie 10 07-01-2009 02:51 AM
Random number generation weird behavior in Win && Linux comparation Bassy Programming 8 03-29-2009 09:39 PM
Bash background (&) with control operators (&&) int0x80 Programming 1 02-11-2009 12:54 PM
SuSE 9.3 Pro Upgrade to existing 9.2 - Buggy KDE & XTERM Behavior adriaticnyc Linux - Newbie 0 05-05-2005 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:26 PM.

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