How to come out of dquote prompt in Terminal - macOS/Linux

TL;DR: Got stuck at dquote> in Terminal? It means you forgot to close a double-quote ("); just type another " and press Enter to exit.

When I was recently working on my Mac Terminal with some usual commands on zsh shell, suddenly, after running the command, I ended up in a dquote> prompt. This seems weird at first, but soon I realised what I had done,

% echo "Hello there! How are you?
dquote>

As you can see when you execute the above echo statement in the macOS/Linux Terminal, the zsh/bash prompt is not returned, instead you see dquote.

What does dquote> means?

If you have a double-quote in your command and you do not close it and execute the command, you end up in dquote. What it means is that the shell is waiting for a closing double-quote. So you can write whatever you want and add as many line breaks. Once you add a double-quote and press enter, the command will get executed and pa rompt will be returned.

Example:
% echo "Hello,
dquote> how are
dquote> you 
dquote> doing 
dquote> today!"

Hello,
how are
you 
doing
today!

%

How to come out of dquote?

How to come out of Terminal dquote prompt

dquote implies the shell (zsh/bash, etc) is waiting for a closing double-quote, so just add a double-quote and press enter!

exiting dquote prompt terminal

This is not an AI-generated article but is demonstrated by a human.

Please support independent contributors like Code2care by donating a coffee.

Buy me a coffee!

Buy Code2care a Coffee!

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!