Sponsored Content
Full Discussion: While true loop stopped
Top Forums Shell Programming and Scripting While true loop stopped Post 303027744 by sadique.manzar on Sunday 23rd of December 2018 05:57:23 AM
Old 12-23-2018
While true loop stopped

Hello Team,

In my shell script, it stopped without killing it.
Could you please help why ?
Below is the code :

Code:
get_dpi44_currentFiles()
{
	truncate --size 0 $dpi_44_fixed_currentFileList
	if ssh $dpi_srvr_44 -p 2222 "ls $dpi_44_sourceFilesDir/fixed | grep '\.tgz$'" > $dpi_44_fixed_currentFileList 2>/dev/null
	then
	Currentfilecount=`wc -l ${dpi_44_fixed_currentFileList}`
	echo -e "`date` Current File List Count for 44 fixed, server port 2222 is :${Currentfilecount} \n" >> $successlog
	else
	echo -e "`date` Connection refused $dpi_srvr_44 \n" >> $failurelog
	Currentfilecount=`wc -l $dpi_44_fixed_currentFileList`
	echo -e "`date` Current File List Count for 44 fixed, server port 2222 is :${Currentfilecount} \n" >> $failurelog
	cp  $dpi_44_fixed_pulledFileList $dpi_44_fixed_currentFileList
	Currentfilecount=`wc -l $dpi_44_fixed_currentFileList`
	echo "`date` Updated Current File List Count due to connection failure from Pulled File list for 44 fixed, server port 2222 is :${Currentfilecount}" >> $failurelog
	break;
	fi
	
}

pulling_dpi44Files()
{
while true
do
	get_dpi44_currentFiles
done
}
pulling_dpi44Files

Kindly guide is this stopped due to break command used in else condition ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

True Shutdown help!

ok, i know the syntax that goes along with the Shutdown command... but my box never wants to ... well... shutdown.. it only halts, kills all the process's, stalls the comp to a complete stop, but does actually kill the monitor and/or shut off the physical computer. it will reboot properly though,... (3 Replies)
Discussion started by: 01000101
3 Replies

2. UNIX for Dummies Questions & Answers

is it true or not

I have heard for a long time that in maybe 2039 Unix will no longer be useable due the length of the date value. Anyone know anything about this? (4 Replies)
Discussion started by: dhlopomo
4 Replies

3. Shell Programming and Scripting

how to exit a while true loop

Hi guys, I'm new to unix but loving it!! BUT this is driving me nuts as i can't work out the best way to do it. I have a while true loop that i use to monitor something. For my own reasons in ths script i have disabled the CTRL C using the trap command. But i want to put in a option to exit... (5 Replies)
Discussion started by: Noob e
5 Replies

4. Shell Programming and Scripting

Bash: Exiting while true loop when terminal is not the focus window

I am running an Ubuntu Gutsy laptop with Advanced Compiz fusion options enabled. I am using xdotool to simulate keyboard input in order to rotate through multiple desktops. I am looking for a way to kill a while true loop when the Enter key (or Control+C if it is easier) is pushed when the... (2 Replies)
Discussion started by: acclaypool
2 Replies

5. UNIX for Dummies Questions & Answers

Funny but true....

Hallo everybody I am having a shell script called auto_run.sh in that only the first line works. the second line which has sed command is working only at the # prompt. not within the shell script. What could be the reason. *... sed 's/ //g' KTI >abc works in another shell script without the... (6 Replies)
Discussion started by: naushad
6 Replies

6. UNIX for Dummies Questions & Answers

stopped processes

When I try to exit a session, the message 'there are stopped processes' appears and I can not log out? Solution, please? (2 Replies)
Discussion started by: operag
2 Replies

7. Shell Programming and Scripting

loop until true

Hi I need help with a script to loop unitl the statement is true done some thing like this until if then cp filename filename.anto fi done Regards, (3 Replies)
Discussion started by: antointoronto
3 Replies

8. Shell Programming and Scripting

Scripts stopped in the shell

Hi, I've been wondering about this for a while and I just don't know where to start looking. Some of my scripts always get stopped when I start them with $ script.plx &in the shell (bash, on Debian lenny, logged in via ssh from a Mac OS machine using Terminal.app). After a few seconds I keep... (4 Replies)
Discussion started by: mregine
4 Replies

9. Shell Programming and Scripting

While loop true problem

hi, i am new in bash scripting. i am trying to write a Bash script to monitor how many process are running in my Redhat6 Linux machine. example : let say there must be always 5 process from the same kind that must run and if one off them fails down the script must wake up another process... (2 Replies)
Discussion started by: zigizag
2 Replies

10. Shell Programming and Scripting

Explaination on if true

Hi Team, I need to know why ppl use If true loop instead of just writing down the sequence of code lines. 1: echo "Line1" if true; then echo "Line2" fi echo "Line3" 2: echo "Line1" echo "Line2" echo "Line3" Could you explain what does the if true loop make difference in 1st compare... (3 Replies)
Discussion started by: chandana hs
3 Replies
DATETIME.SETISODATE(3)							 1						    DATETIME.SETISODATE(3)

DateTime::setISODate - Sets the ISO date

       Object oriented style

SYNOPSIS
public DateTime DateTime::setISODate (int $year, int $week, [int $day = 1]) DESCRIPTION
Procedural style DateTime date_isodate_set (DateTime $object, int $year, int $week, [int $day = 1]) Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $year - Year of the date. o $week - Week of the date. o $day - Offset from the first day of the week. RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Changed the return value on success from NULL to | | | DateTime. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 DateTime.setISODate(3) example Object oriented style <?php $date = new DateTime(); $date->setISODate(2008, 2); echo $date->format('Y-m-d') . " "; $date->setISODate(2008, 2, 7); echo $date->format('Y-m-d') . " "; ?> Procedural style <?php $date = date_create(); date_isodate_set($date, 2008, 2); echo date_format($date, 'Y-m-d') . " "; date_isodate_set($date, 2008, 2, 7); echo date_format($date, 'Y-m-d') . " "; ?> The above examples will output: 2008-01-07 2008-01-13 Example #2 Values exceeding ranges are added to their parent values <?php $date = new DateTime(); $date->setISODate(2008, 2, 7); echo $date->format('Y-m-d') . " "; $date->setISODate(2008, 2, 8); echo $date->format('Y-m-d') . " "; $date->setISODate(2008, 53, 7); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2008-01-13 2008-01-14 2009-01-04 Example #3 Finding the month a week is in <?php $date = new DateTime(); $date->setISODate(2008, 14); echo $date->format('n'); ?> The above examples will output: 3 SEE ALSO
DateTime.setDate(3), DateTime.setTime(3). PHP Documentation Group DATETIME.SETISODATE(3)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy