Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • sed -i not fit for solaris Commented Aug 29, 2012 at 6:31
  • updated my answer. Commented Aug 29, 2012 at 6:39
  • Even with GNU sed, that can be a problem (when POSIXLY_CORRECT is set) as [ \t] is meant (as per POSIX) to match space backslash or t. You want [[:blank:]] instead which is POSIX. Commented Aug 29, 2012 at 13:31
  • For the perl version, use s/=\s*/=/g. and if there's any chance there might be whitespace before the = as well as after it, use: s/\s*=\s*/=/g. and the /g modifier is only necessary if there's a chance there might be more than one = symbol needing whitespace stripping per line. Commented Aug 30, 2012 at 2:53