Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to use a sed line with a + on a Solaris machine and on a Linux machine.

on Solaris sed does not remove the strings until the first number like I want:

   solaris:/ ROOT > echo "Release............"  | sed 's/[^0-9]\+//'


on Linux I get the expected results:

  linux tmp]# echo "Linux Release............"  | sed 's/[^0-9]\+//'
  • Why is this sed syntax not working on Solaris?

  • What do I need to change in the syntax in order for it to run on Solaris?

share|improve this question
up vote 0 down vote accepted

Normally, escaping the + character (\+) results in a literal +, not a modifier. This is not the case with sed on Ubuntu 10.04, but it might not be on Solaris.

My best guess it that this is implementation-specific, so sed 's/[^0-9]\+//' might work.

You could also try sed -r 's/[^0-9]\+//' (where -r means extended regular expressions). It works on Ubuntu 10.04.

share|improve this answer
that doesn't seem to be correct - it's just that the solaris sed doesn't support '+'. the same question by the same author here seems to have more info : – Richlv Apr 11 at 11:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.