Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 01-08-2010, 07:11 AM   #1
LQ Newbie
Registered: Apr 2007
Posts: 10

Rep: Reputation: 0
running back ground jobs in bash


while true; do
TGT_NODE=`qstat | grep -w $jobid | awk '{print $8}'| cut -d"@" -f2 | cut -d"." -f1`
if [ -z "$TGT_NODE" ]
echo "Job $jobid not found"
exit 1
rsh $TGT_NODE $jobid
echo "freq_count=$freq_count"
sleep $freq_count

I am trying to execute the above script as back ground job
./ 1001 3 &
nohup sh 1001 3 > cfx.out &

In the both cases the as soon as the execution reaches sleep command it shall not be precede further any more.

May I know the reason for why is this happening?

But this same script works perfectly when I run as bash script. Finding issue only when I ran as background job.

Last edited by tcegrid; 01-09-2010 at 03:40 AM. Reason: typo in variable name
Old 01-08-2010, 07:21 AM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Where are you assigning a value to the variable "freq_count"?
Old 01-09-2010, 03:45 AM   #3
LQ Newbie
Registered: Apr 2007
Posts: 10

Original Poster
Rep: Reputation: 0
typo the variable name count. actually it is freq_count only.


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
Grub ..changing default back ground image?? stratotak Debian 4 12-07-2017 10:21 PM
[SOLVED] [bash]Pick up process running in back up by another terminal... RaptorX Linux - General 5 09-02-2009 01:29 PM
LXer: Watch Your Back(ground) LXer Syndicated Linux News 0 07-17-2009 08:21 PM
what is command to display the process which is running in the back ground vinaykori Linux - General 2 02-07-2008 09:35 PM
running jobs in background in bash markhod Linux - Software 2 10-08-2003 07:11 PM > Forums > Linux Forums > Linux - Distributions > Red Hat

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

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