Thanks ALL Once again we have demonstrated that by using "standard" tools that there are multiple ways of hollowing out a feline.
As it turns out sed on this particular *nix doesn't understand -r, requiring backslashing roundy brackets etc. Also "groupsoffour" is too long for a label - easily shortened And there wasn't a Python interpreter installed. But most importantly I learned a few things that I will need when I least expect it. Thanks guys gc On 28 June 2011 17:32, Jim Cheetham <[email protected]> wrote: > On Tue, Jun 28, 2011 at 4:50 PM, Kent Fredric <[email protected]> > wrote: > > On 28 June 2011 16:26, Jim Cheetham <[email protected]> wrote: > >> sed and awk can do pretty much anything. The syntax is ugly as hell, > >> and not readable for updates later, and that's why we have better > >> languages now. > > > > I should also point out on some Unixen, 'sed -r' may not exist or may > > not work the way you expect it to. > > Agreed. It's on solaris, but I don't think it's on *bsd. > > In any case, all the -r is doing as far as I can be bothered telling, > is allowing me to use {count} and () without resorting to quoted > brackets and explicit counts. > > This one works without the extended regexp ... > > echo abcdefghijklmnopqrstuvwxyz | sed -e ' > s/^\(.....\)\(.*\)$/\1Z\2/ > :groupsoffour > s/^\(.*Z\)\([^Z][^Z][^Z][^Z]\)\([^Z]*\)$/\1\2Z\3/ > t groupsoffour > s/^\(.....\)Z\(.*\)$/\1\2/ > > > However, that perl syntax /should/ work on everything, including > > http://bellard.org/jslinux/ is a busybox machine, for example ... that > doesn't have perl, but it does have a decent sed :-) > > I'm not sure if it works, because it is taking *ages* to execute ... > and I don't think I can wait that long! > > Just noting that not all Unix boxes are big enough to run > (perl|ruby|whatever) ... however in practice, if your box isn't big > enough to run perl, perhaps you shouldn't run large regexps and do odd > text processing anyway! > > -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
