The real world application of this exercise was to scripturally edit a load of text configuration files in response to a change in specification.
Each config file consists of one record per line - not fixed length The new specification didn't affect the first fifty-something characters of each record, so they were to be retained intact. Position fifty-something to end-of-line consisted of numerous 36 character fields, plus a handful of trailing characters also not affected by the new specification. The new specification increased the 36 chars fields to 37 chars, requiring a <space> to be appended as a filler. The 'human' approach would be a nested 'for' loop - for each config file, do for each record, do for each field . . . etc This 'human' is too lazy & impatient for such tomfoolery, when "there's got to be a better way". The environment is bash on Sco Unix. gc PS yes - these config files were devised in the late 80's - long before xml. On 1 July 2011 15:24, Jim Cheetham <[email protected]> wrote: > On Fri, Jul 1, 2011 at 2:28 PM, Kent Fredric <[email protected]> > wrote: > > Found an edge case: abcd -> abcdZ > > > > https://gist.github.com/1057759 > > Fantastic! > > Now I have to think about how to prevent it from happening (or > actually, how to clean up afterwards), and whether preventing it is > even necessary, given the original problem description. > > Hey Glenn, care to share some comments about what you were really > doing with this? And what your limited platform is? > > -jim > > _______________________________________________ > Linux-users mailing list > [email protected] > http://lists.canterbury.ac.nz/mailman/listinfo/linux-users >
_______________________________________________ Linux-users mailing list [email protected] http://lists.canterbury.ac.nz/mailman/listinfo/linux-users
