![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| checking the smallest and largest number | subin_bala | Shell Programming and Scripting | 4 | 04-24-2008 04:32 AM |
| Sequence number generation on a key column | sbasetty | Shell Programming and Scripting | 6 | 03-27-2008 08:09 AM |
| checking invoice number not correct | happyv | Shell Programming and Scripting | 8 | 03-29-2007 02:07 AM |
| help - script can check jump sequence? | happyv | Shell Programming and Scripting | 9 | 09-20-2006 07:23 PM |
| sequence number checking | nhatch | UNIX for Dummies Questions & Answers | 1 | 04-24-2003 11:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
checking jump sequence number (part2)
The following script have some bug...can you all help me:
#!/bin/sh start=1 for file_number in `ls -1 /appl/CH_DATA/archive/list1/CACHE/CDBACKUPFILEJohn*.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 echo "file names $file_number are not in sequence " fi fi previous=$file_number done For the above, I have problem to list CD*.archived in directory, because of I have same filename with *.archived and *_bup.archived. 1 - I just want to list out CD*.archived 2 - I have alot filename like CDBACKUPFILEJohn*, CDBACKUPFILEMARRY*, CDBACKUPFILEPETER*, etc. Can I put all name into the name.txt and the script can read the name.txt and put into the scrip like CDBACKUPFILE$name? Thanks!! |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
Thank's it work! How about the filename "John" can I read from the list.txt (because of over 300 different filename) and check the seq? |