Ipsita Tah
Ipsita Tah

Reputation: 267

sed command garbled for solaris

I want to execute the below line:

sed -n '/description/!{H;d}; /description/ {x; /XCJDAST/p}; $ {x; /XCJDAST/p}' tsgroupsPrevious.xml

This is working fine for Unix but not working for solaris,giving command garbled error

Upvotes: 0

Views: 1385

Answers (1)

NeronLeVelu
NeronLeVelu

Reputation: 10039

sed -n '#Solaris version
/description/!{
   H;d
   }
/description/ {
   x; /XCJDAST/p
   }
$ {
  x; /XCJDAST/p
  }' tsgroupsPrevious.xml
  • after a d, sed stop the script even with a ; after, not in linux
  • ; is a substitute for line separator, not always available in non GNU sed script especially in group of action (and after command like d)
  • also, comment must start on first character of a line

Upvotes: 1

Related Questions