![]() |
|
|
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 |
| checking the smallest and largest number | subin_bala | Shell Programming and Scripting | 4 | 04-24-2008 08:32 AM |
| Invoice Processing in a Service-Oriented Environment | iBot | Oracle Updates (RSS) | 0 | 04-18-2008 07:10 PM |
| plz correct this | wannalearn | Shell Programming and Scripting | 8 | 04-26-2007 08:56 AM |
| checking jump sequence number (part2) | happyv | Shell Programming and Scripting | 3 | 10-19-2006 07:03 AM |
| sequence number checking | nhatch | UNIX for Dummies Questions & Answers | 1 | 04-24-2003 03:25 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
checking invoice number not correct
hello,
I have the following script to check the invoice number is in order or not. However, it cannot show out the correct information. My expect output show below and I would like to only list out the NOT IN SEQUENCE inovice number (not included "ok") #!/bin/sh start=1 for file_number in `ls -1 /appl/appl/archive/client/CACHE/CLIENTINVOICE*[0-9].archived | sort | cut -c 48,49,50,51` do if [ $start -eq 1 ] ; then # this is the first pass of the loop, so we've got nothing to compare start=0 previous=$file_number else # this is not the first pass of the loop previous=`expr $previous + 1` echo "comparing $file_number and $previous ... " if [ $file_number = $previous ] ; then echo "OK" else seqno=`expr $file_number - 1` echo "CLIENTINVOICE$invoiceno are not in sequence " fi fi previous=$file_number done input: 01185 01191 01192 01193 01196 01197 . . . script output: 01190 are not in seq 01195 are not in seq expect output 01186 are not in seq 01187 are not in seq 01188 are not in seq 01189 are not in seq 01190 are not in seq 01194 are not in seq 01195 are not in seq |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|