|
Home > Archive > Unix Shell > November 2006 > Unterminated `s' command, a thanksgiving qustion
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Unterminated `s' command, a thanksgiving qustion
|
|
| learner 2006-11-22, 1:39 am |
| Hi, everybody,
I have the data file input.dat :
A1
B1
C1
and I wrote the following script file sed1.src to change A1->C1,
B1->A1,C1->B1
{
s/A1/C1
t
s/B1/A1
t
s/C1/A1
t
}
and I issure the command : sed -f sed1.src input.dat
got the error saying : Unterminated `s' command in line 2
what is the problem?
thanks
| |
| Lew Pitcher 2006-11-22, 1:39 am |
|
learner wrote:
> Hi, everybody,
> I have the data file input.dat :
> A1
> B1
> C1
> and I wrote the following script file sed1.src to change A1->C1,
> B1->A1,C1->B1
> {
> s/A1/C1
> t
> s/B1/A1
> t
> s/C1/A1
> t
> }
>
> and I issure the command : sed -f sed1.src input.dat
>
> got the error saying : Unterminated `s' command in line 2
>
> what is the problem?
s/A1/C1
should be
s/A1/C1/
In fact, all the other s commands should have a terminating slash
|
|
|
|
|