![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| __read_nocancel Function Causes Infinite Loop | marcus121 | High Level Programming | 3 | 06-09-2009 11:27 AM |
| Is my code in an Infinite Loop? | marcus121 | High Level Programming | 5 | 06-05-2009 02:45 PM |
| Script to run infinite loop | digitalrg | Shell Programming and Scripting | 1 | 04-15-2009 01:23 PM |
| Infinite loop not looping | hootdocta5 | Shell Programming and Scripting | 2 | 03-23-2009 12:38 PM |
| ls command in infinite Loop | umakant | SUN Solaris | 3 | 07-17-2007 02:25 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
infinite while do loop problem
hi all, this is how my scrip looks like Code:
#!/bin/sh
bindir='/opt/apps/script/bin'
datadir='/opt/apps/script/data'
dir='/opt/apps/script'
while : ; do
ls -1rt /opt/apps/script/data/check.txt*|tail -1 > /dev/null 2>&1
if [ $? -eq 0 ] ;then
chmod +rwx $bindir/dummy2.sh
lastfile=`ls -1rt /opt/apps/script/data/check.txt*|tail -1` > /dev/null 2>&1
cp $lastfile $dir/backup/
cp $lastfile $datadir/IPLIST.txt
else
chmod -rwx $bindir/script_check2.sh
exit 0
fi
done
Its giving me infinite loop. The check.txt is not in the /opt/apps/script/data/ directory, so I thought I wanted it to do chmod -rwx $bindir/script_check2.sh and exit script straight away. please help. Last edited by tententen; 07-16-2009 at 08:57 AM.. Reason: code tags |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|