![]() |
|
|
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 |
| loop and check | dnat | Shell Programming and Scripting | 2 | 10-22-2008 06:39 AM |
| Check for statup process in loop? | dataciph3r | Shell Programming and Scripting | 1 | 09-25-2008 10:18 PM |
| Loop to check for file up to 3 times | JohnCrump | Shell Programming and Scripting | 2 | 07-16-2008 06:54 AM |
| looking for help with a dd loop check script | angusyoung | Shell Programming and Scripting | 1 | 06-24-2008 07:51 AM |
| script to loop and check jumping seq. | happyv | Shell Programming and Scripting | 1 | 10-05-2006 10:55 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Loop check
Hi Gurus I have a recquirement where my loop should work if i have more than 4 listed files in a particular directory. Like the loop in while should continue checking if the directory has more than 4 files and should exit after there are 4 or more files ; if not more than 4 files it should continue checking the number of files Need help for achieving this scenario Code:
cd /export/home/e299821/rohan linecount=`ls -ltr | wc -l` a=0 echo $linecount echo $a while [[ $a = 0 ]] do if [ $linecount -gt 3 ] then echo $lineocunt a=`expr $a + 1` echo "loop completed" fi done Last edited by vgersh99; 07-17-2009 at 08:47 AM.. Reason: code tags, PLEASE! |
| Bits Awarded / Charged to r_t_1601 for this Post | |||
| Date | User | Comment | Amount |
| 07-17-2009 | vgersh99 | added code tags - charged 3K bits | -3,000 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|