BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] Please help with a BASH puzzle
- Subject: [Discuss] Please help with a BASH puzzle
- From: bill at horne.net (Bill Horne)
- Date: Fri, 23 Aug 2019 19:17:50 -0400
- In-reply-to: <cada1d7f-db66-b8dd-5b07-587ecf1ff685@thekramers.net>
- References: <cccf29d6-362e-020f-f28b-d0e950ee002f@horne.net> <cada1d7f-db66-b8dd-5b07-587ecf1ff685@thekramers.net>
David, Thank you for your suggestion, but they are not only number, but alpha values too. Sorry, though: I chose poor examples.? The file can contain any digit 0-9, and any alpha A-Z. There are no punctuation marks and no white space. Sorted values range from 0000 to ZZZZ. HTH. Bill On 8/23/2019 6:51 PM, David Kramer wrote: > Are these hex numbers?? bc can convert hex to decimal and do hex > math.? The hard part is calculating the next value, and here's an > example of doing that. > > nextValue=`echo "obase=16; ibase=16; ${lastValue} + 1" | bc` > > Then all you need to do is compare whether the next line you read is > equal to nextValue. > > > On 8/23/19 6:32 PM, Bill Horne wrote: >> Thanks for reading this: I appreciate your time. >> >> I'm trying to do something that should be very easy to do, and yet I >> can't remember how to do it, and I'm asking for help. >> >> I have an alpha-numeric, sorted file, that looks like this: >> >> 01AA >> >> 01AB >> >> 01AC >> >> 01AE >> >> 01AF >> >> .. etc. >> >> I'm trying to remember what BASH utility, script, or? command would >> flag the missing value (in this case, "01AD"). There are, of course, >> any number of ways to program a solution, but I can't remember which >> of the BASH utilities will do it. All suggestion welcome, and thanks >> in advance. >> >> Bill Horne >> >> _______________________________________________ >> Discuss mailing list >> Discuss at blu.org >> http://lists.blu.org/mailman/listinfo/discuss > _______________________________________________ > Discuss mailing list > Discuss at blu.org > http://lists.blu.org/mailman/listinfo/discuss
- Follow-Ups:
- [Discuss] Please help with a BASH puzzle
- From: david at thekramers.net (David Kramer)
- [Discuss] Please help with a BASH puzzle
- References:
- [Discuss] Please help with a BASH puzzle
- From: bill at horne.net (Bill Horne)
- [Discuss] Please help with a BASH puzzle
- From: david at thekramers.net (David Kramer)
- [Discuss] Please help with a BASH puzzle
- Prev by Date: [Discuss] Please help with a BASH puzzle
- Next by Date: [Discuss] Please help with a BASH puzzle
- Previous by thread: [Discuss] Please help with a BASH puzzle
- Next by thread: [Discuss] Please help with a BASH puzzle
- Index(es):