Il giorno lun, 08/10/2007 alle 17.59 +0100, Glynn Clements ha scritto: > I must be going blind; I missed that '*' the first time around. '^*$' > isn't (AFAICT) a valid regexp, as the '*' must be preceded by an > expression, and I don't think that '^' counts in this context.
I noticed that, but see below for some more details. > I suspect that this is causing grep to get stuck in an infinite loop. > The * operator repeatedly matches the preceding expression until it > fails. But matching against ^ doesn't advance the pointer, so no > matter how many times it matches ^, it's still at the start of the > line. > > If it's meant to eliminate lines which consist of nothing but an > asterisk, it should be: > > grep -v '^\*$' I tried this and it was slow just as its `wrong' counterpart '^*$'. In fact, I tried both the right and wrong regexps _without_ the -v flag to see which lines where matching: in both cases ('^*$' and '^\*$') on my system all NULL cells (represented by *) were matching the regexp, and the grep was taking hours to complete. My MASK actually leaves about 99% of the cells out. Given the fact that the Debian package update took away the problem, I ended up thinking that it was grep badly behaving with the -v flag. But I have no clues about that. Best, Stefano -- Stefano Costa [EMAIL PROTECTED] http://www.iosa.it Archeologia e Software Libero Io uso Debian GNU/Linux! _______________________________________________ grassuser mailing list grassuser@grass.itc.it http://grass.itc.it/mailman/listinfo/grassuser