In the original sed
, I think a label had to be on a line by itself. From my very ancient sed & awk
Nutshell book, it states:
A lable is any sequence of up to seven character. A label is put on a line by itself and beginning with a colon:
:label
That means, you need to separate it from the rest of the script with multiple -e
arguments or see if you have nawk
or gawk
on your Solaris box. Alternatively, since it appears you just want to replace all newlines with spaces, there are better tools for the job, such as tr
, the translate utility, which should at least be as ubiquitous as sed
:
a=`tr '\n' ' ' <file.txt`