lidia
lidia

Reputation: 3183

sed on sun solaris

I am try to do the following on sun solaris

    sed   "/ADDRESS/a \
           PROTOCOL"  file  > NEW_file

but I get:

sed: command garbled: /ADDRESS/a PROTOCOL

why (on linux its work) ,

is it possible to support syntax that work on linux and on sun

lidia

Upvotes: 1

Views: 1161

Answers (2)

ghostdog74
ghostdog74

Reputation: 342263

here's another way, use nawk

nawk '/ADDRESS/{$0=$0" PROTOCOL"}1' file

Upvotes: 0

jlliagre
jlliagre

Reputation: 30803

This syntax is a Gnu sed extension. It works on Gnu/Linux because you have a Gnu userland with it. It works on Solaris if Gnu sed is installed on it. It might be in /usr/gnu/bin/sed, /usr/sfw/bin/gsed or somewhere else, depending on the Solaris release you are using.

Upvotes: 0

Related Questions