2

I get these error messages when launching bash or zsh in standard Terminal.app or iTerm2

sed: 1: "\#^system_type=# { s#^s ...": extra characters at the end of p command
sed: 1: "\#^system_type=# { s#^s ...": extra characters at the end of p command
sed: 1: "\#^system_name=# { s#^s ...": extra characters at the end of p command
sed: 1: "\#^system_name=# { s#^s ...": extra characters at the end of p command
sed: 1: "\#^system_name_lowercas ...": extra characters at the end of p command
sed: 1: "\#^system_name_lowercas ...": extra characters at the end of p command
sed: 1: "\#^system_version=# { s ...": extra characters at the end of p command
sed: 1: "\#^system_version=# { s ...": extra characters at the end of p command
sed: 1: "\#^system_arch=# { s#^s ...": extra characters at the end of p command
sed: 1: "\#^system_arch=# { s#^s ...": extra characters at the end of p command

How can I fix it?

4
  • Is this bash or zsh? Why have you tagged with both?
    – terdon
    Jun 28, 2014 at 14:12
  • Errors appear both in bash and zsh.
    – Artem Pakk
    Jun 28, 2014 at 14:52
  • Ah! Then the problem is most likely in /etc/profile. Have you changed that file? Did you try the grep command from my answer?
    – terdon
    Jun 28, 2014 at 14:53
  • There is nothing remotely suspicious in /etc/profile and ~/.profile and I haven't changed these files recently. grep doesn't give any results either.
    – Artem Pakk
    Jun 28, 2014 at 15:13

2 Answers 2

1

Check the .bash_profile file in your home directory. The commands in this file are read whenever a terminal starts.

The offending sed commands should be found in that file, if not then check /etc/profile forsed` commands.

0

This means that you have some incorrect sed commands in one of your shell's initalization files. Since you're using bash and OSX, this will be one of ~/.profile,~/.bash_profile,/etc/profile, /etc/environment (though the latter is extremely unlikely). To find out which one, run

grep system_type ~/.profile ~/.bash_profile /etc/profile /etc/environment

You've also tagged this as zsh. I know that OSX runs bash login shells by default, but I have no idea if they've done the same for zsh. Assuming they haven't and zsh starts a normal non-login shell, you should check ~/.zsshrc at least. Not sure what other startup files zsh sources.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .