I replaced sed with the GNU version on my Mac. I thought I made a backup of the original (BSD version), but apparently I didn't, and now I need it back. Can someone help me?
Asked
Active
Viewed 774 times
1 Answers
2
The "original" BSD sed in OS X is found at /usr/bin/sed.
werner@macleod ~/Desktop% which sed
/usr/bin/sed
The GNU version of sed – at least the one installed with Homebrew – is at /usr/local/bin/sed.
If the GNU version takes precedence over your system sed, you need to change the PATH in your shell so it references /usr/bin before /usr/local/bin. Confirm the existence of both by typing which -a sed.
To restore a binary that came with OS X, you can also use Pacifist and your OS X installation disc – if you have one, that is. Refer to this answer for a step-by-step instruction for Ruby, but sed should be somewhere in there as well.