The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
"Break" from a Loop sumeet Shell Programming and Scripting 2 05-18-2008 10:36 PM
Urgent:Comparing two Strings using If Loop Anji Shell Programming and Scripting 2 01-09-2008 04:54 AM
ssh break the while loop? fedora Shell Programming and Scripting 5 05-23-2007 07:54 AM
URGENT,URGENT- Need help tape drive installation sriny UNIX for Advanced & Expert Users 3 11-16-2006 11:43 AM
ksh how user can break out of loop beckett Shell Programming and Scripting 4 04-07-2004 03:55 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2008
Registered User
 

Join Date: Mar 2008
Posts: 36
How to break the while loop???(Very Urgent)

H,

I am running the following log.sh shell script.

$no_of_ps=7
while [ $no_of_ps -gt 0 ]
do
echo "hello $no_of_ps"
ps_file=`tail -$no_of_ps /tmp/A380_RFS24/test.ls | head -1`
no_of_ps=`expr $no_of_ps - 1`
echo "package is: $ps_file" >> /tmp/A380_RFS24/log/A380_RFS24.log
ps_file1=`echo $ps_file| sed "s/.ps//g"`
echo "after deleting .ps extension package is: $ps_file1" >> /tmp/A380_RFS24/log/A380_RFS24.log
ps2pdf -dSAFER -sPAPERSIZE=a4 /tmp/A380_RFS24/amm_r0_ps/$ps_file1.ps /tmp/A380_RFS24/amm_r0_pdf/$ps_file1.pdf >> /tmp/A380_RFS24/log/A380_RFS24.log
staus_gscript=$?
echo "status after converting .ps to .pdf is: $staus_gscript" >> /tmp/A380_RFS24/log/A380_RFS24.log
if [ $staus_gscript -eq 1 ]
then
break
fi
done


When i am running the above script i am getting the output. But how shell i break my While loop when i didnot get any input in 2nd line of test.ls file??
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-21-2008
Registered User
 

Join Date: Jan 2008
Posts: 52
Can you give an example or elaborate it...
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0