I know if sed
is GNU version, version check can be done like
$ sed --version
But this doesn\'t work in OS X. How can I do that
Looking though the various version of sed
in text_cmds there are not many changes.
10.0.0
Used NetBSD sed
from fall 199810.3.0
Used FreeBSD sed
from fall 2002 but left the man-page unchanged,
adding -E
extended regular expressions and -i
in-place editing.10.4.0
Had some fixes for in-place editing, and changed the man-page to
the FreeBSD man-page from fall 2004.10.5.0
Updated to FreeBSD sed from fall 2005, adding -l
line-buffered output and more refinements/fixes to in-place
editing.10.6.0
Added a reference to compat(5)
in the man-page.The version of the operating-system can be checked, instead of the sed
utility, by either using uname -r
or sw_vers -productversion:
case $(sw_vers -productversion) in
10.[012].*) echo no in-place editig, EREs, or line-buffered output;;
10.[45].*) echo no line-buffered output;;
10.[6789].*) echo newest version as of writing;;
10.1[01].*) echo newest version as of writing;;
esac
(BSD utilities are not versioned because they are considered part of their operating-system)