Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


".zshrc:4: command not found: n#" when opening a new terminal window #204

carlisia opened this Issue · 6 comments

3 participants


Maybe this would be best open as a question, not sure.

I just ran the script on my machine and now I get the following:

Last login: Tue Mar 4 13:10:42 on ttys001
/Users/carlisia/.zshrc:4: command not found: n#

I searched the issue list and nothing like that was found.


Can you post your .zshrc ? Perhaps the error is on line 4, but it'd be great to see either way.


Here it goes:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH="$HOME/.bin:$PATH"
\n# recommended by brew doctor
export PATH="/usr/local/bin:$PATH"\n
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - --no-rehash)"


Somehow lines like these snuck back in:

echo "\n..."
echo "...\n"

Bash (OSX) will not interpret these escapes without the -e flag. This is unlike Dash (Debian) which will.

This is why we prefer printf in our best practices. I can fix on Friday if no one gets to it first.

echo is a portability train wreck. No major shell follows POSIX completely, and any shell that attempts to do so should be considered horribly broken. SUSv4 specifies that echo shall not include any options. Further, it specifies that the behavior of -n as a first argument shall be determined by the implementation, unless XSI is followed, in which case -n is always treated as a string, and backslash escapes are interpreted by default. dash has the misfeature of following this and interpreting escapes by default, but includes a -n feature for suppressing newlines nevertheless.

source. Emphasis mine.


Thanks, @pbrisbin ! @carlisia , all you should need to do is remove that line and it should work OK.


Ok, thanks.


Fixed with 5765e1e

@pbrisbin pbrisbin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.