1

So today I wanted to add some extra alias to zsh.

  • I did the usual

    nano ~/.zshrc
    

    and added my alias

    ex:

    alias desktop="cd desktop"
    

    (I've doubled checked that all variables for typos)

    Ctrl+O to save and Ctrl+X to exit.

  • After getting out I run:

    source ~/.zshrc
    

    And get the following error:

    /Users/fridavbg/.zshrc:116: unmatched "
    
  • When running I get:

    echo $SHELL
    /bin/zsh
    

Any kind soul out there that could help me out or give me some resource that might help me figure out how to fix this?

It feels like this is something simple, but I'm a little scared to mess my path up completely.

1
  • 1
    can you post output of \sed '116!d' /Users/fridavbg/.zshrc? Commented Jan 29, 2021 at 12:52

2 Answers 2

4

Your error message is not unmatched, it is unmatched ", as in there is an unmatched quote character, ".

The part /Users/fridavbg/.zshrc:116 exlains that this error was detected in file /Users/fridavbg/.zshrc on line 116.

So you should look at that file around the indicated line for unmatched quotes. Note that sometimes the indicated line is not the line where there error is. If you don't find an error on the indicated line, it may be before that line, or sometimes after that line.

Example:

command1 "missing quote at the end
command2 ""

Here the quote started on the first line continues to the first quote character on the second line, and the quote starting with the second quote character is not terminated.

1
  • Find lines with only 1 ": grep -E -n '^[^"]*"[^"]*$' /Users/fridavbg/.zshrc
    – waltinator
    Commented Jan 29, 2021 at 20:05
0

Another wild guess: instead of an ASCII double quote (") one of them is inadvertently a Unicode curly “double” quote.

Some editors, in a misguided attempt to be helpful, insert/convert these without telling you.

You must log in to answer this question.

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