Surprisingly, that works! This did too:
sed -e ':loop' -e 's/^\( *\) /\1 /;t loop' infile
but trying to put it all together like I posted still doesn't. :~(
I'm still puzzeled, but I do feel somewhat better. :-)
Chuck Demas
Needham, Mass.
--
Eat Healthy | _ _ | Nothing would be done at all,
Stay Fit | @ @ | If a man waited to do it so well,
Die Anyway | v | That no one could find fault with it.
de...@tiac.net | \___/ | http://www.tiac.net/users/demas
>>It looks as if your sed does not recognize ; as the end of a label.
>>sed -e ':loop' -e 's/^\( *\) /\1 /' -e 't loop'
>Surprisingly, that works! This did too:
>
>sed -e ':loop' -e 's/^\( *\) /\1 /;t loop' infile
>
>but trying to put it all together like I posted still doesn't. :~(
>
>I'm still puzzeled, but I do feel somewhat better. :-)
Well, both the error message and bmarcum's explaination seem
clear to me, but let's try putting it a different way...
When the particular implementation of sed that you are using
sees a ":" beginning a label, it considers the rest of the
line as being the label name, no matter what it contains.
Thus, with this sed:
sed ': loop;s/^\( *\) /\1 /;t loop' infile
is interpreted as a script consisting of the single strange label:
loop;s/^\( *\) /\1 /;t loop
and no other commands; sorta a verbose version of this script:
sed : infile
both of which would be equivalent to:
cat infile
except that your sed has a limit on the length of a label,
probably 8 characters, and so it bails when it sees your
long (and strange) label.
Other implementations of sed disallow ;s as part of a label's
text, and instead do what you were expecting --- cause the label
end just before the ;, and the s/// command to be recognized.
--Ken Pizzini
Yes, I understand what's being said, what puzzeled me was how this
version of sed could be released when (IMO) it is so badly broken
in this respect.
FWIW, this problem occurred on:
IRIX64 world 6.2 03131016 IP19
--
--
Peter S Tillier pet...@eq1152.demon.co.uk
Peter....@BTinternet.com
Fax2Email 0870 052 2717
Opinions expressed are my own and not necessarily those of my employer.
Charles Demas wrote in message ...
<snip>
>
>Yes, I understand what's being said, what puzzeled me was how this
>version of sed could be released when (IMO) it is so badly broken
>in this respect.
>
>FWIW, this problem occurred on:
>
>IRIX64 world 6.2 03131016 IP19
<snip>
FWIW this is a very common problem in sed and is perhaps why the FAQ
counsels you to use separate -e expressions for labels and writes.
Peter
--
Peter S Tillier pet...@eq1152.demon.co.uk
Peter....@BTinternet.com
Fax2Email 0870 052 2717
Opinions expressed are my own and not necessarily those of my employer.
>Yes, I understand what's being said, what puzzeled me was how this
>version of sed could be released when (IMO) it is so badly broken
>in this respect.
Ah. It may be "badly broken", but it is more common to find
seds which (mis)behave in this manner than it is to find ones
which don't.
--Ken Pizzini
In my previous post I mentioned that the effect applies to labels and
writes - it also applies to reads, tests (in most sed implementations) and
closing braces } (in some seds).
Peter--
Peter S Tillier Peter....@BTInternet.com
pet...@eq1152.demon.co.uk