Перейти к содержимому

Как выйти из quote в терминале

  • автор:

Как отсюда выйти: шпаргалка по Vim

Потратив несколько минут на эту статью, вы познакомитесь с основами популярного текстового редактора Vim (и научитесь быстро выходить из него).

Обложка поста Как отсюда выйти: шпаргалка по Vim

Вы собираетесь создать файл crontab и внезапно оказываетесь в этом странном редакторе по умолчанию. В том, в котором всё никак не разберётесь.

ESC? Ничего не произошло. CTRL + C? Нет. ESC ESC ESC? Неа. Вы в тупике.

Ну вот, опять. Склонив голову от стыда, вы запускаете очередной терминал, чтобы исполнить команду killall vim и продолжить заниматься своими делами.

С вами бывало такое? Конечно, бывало. Что ж, потратив несколько минут на эту статью, вы познакомитесь с основами редактора Vim (и научитесь быстро выходить из него).

Vim по умолчанию установлен во многих операционных системах (включая большинство дистрибутивов Linux и macOS), поэтому хотя бы поверхностные знания о нём лишними не будут. Откройте терминал и введите vim .

В умелых руках Vim может стать мощнее многих IDE. И, разумеется, он не ест сотни мегабайт памяти лишь для отображения пустого файла (да, Eclipse, это о тебе).

Основы

Некоторые из нижеописанных команд начинаются с двоеточия: нажав его, появится подсказка, в которой будет указана полная команда. Команды без двоеточий — это скорее горячие клавиши, которые можно использовать в режиме по умолчанию (в нём запускается Vim). Команды, написанные ЗАГЛАВНЫМИ БУКВАМИ — это отдельные клавиши: например, ESC — это клавиша Esc на вашей клавиатуре.

Все команды чувствительны к регистру и должны выполняться вне режима insert.

Выход из Vim

Выход без сохранения изменений:

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

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 shell is waiting for a closing double-quote. So you can write what ever you want and add as many line breaks, once you add a double-quote and press enter the command will get executed and prompt is returned.

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

How to come out of dquote?

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

  • How to Display Analog Clock on Mac Menu Bar
  • Shutdown Mac Terminal Command
  • How to know the Serial Number of MacBook on macOS Ventura 13.0
  • macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing
  • [fix] How to Show file extensions on all files on Mac
  • How to install Zoom Add-in to Outlook (Mac)
  • How to turn off Stage Manager — macOS Ventura
  • Fix — Xode — Internal logic error: Connection was invalidated
  • How to do calculations in Mac Terminal
  • How to delete a Page in Microsoft Word File on Mac (macOS)
  • How to Refresh Mac Desktop
  • How to install Java on macOS [Big Sur]
  • How to Disable Mac Terminal Bell Sound
  • Installing MongoDB on Linux/Unix/macOS/Ubuntu
  • How to Uninstall Brew on Mac
  • Find your macOS version
  • Change TextEdit File Encoding
  • AppleScript Example with TextEdit
  • How to install homebrew (brew) on M1 Mac
  • How to Find File and Directory Size in Mac Terminal
  • How to open new tab in Sublime Text Editor [macOS]
  • How to list all users in Mac Terminal
  • Turn off Auto-Capitalization on macOS Ventura 13
  • How to check Command Line Tools Version [Updated for Ventura]
  • Change Current User Password using Mac Terminal Command
  • How to display line numbers in Terminal while displaying content of a file — HowTos
  • Fix: Jupyter Notebook Black Web Page on Localhost — Python
  • Share or Send SMS via Android Intent — Android
  • ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash] — Linux
  • Read a file using Java 8 Stream — Java
  • Clone Bitbucket repo in VS Code — HowTos
  • Microsoft Stream — This may not be for you, It looks like you don’t have permission to watch this video — Microsoft
  • How to Search Maven Central Repository — HowTos

Как выйти из git log?

Написал в git git log Мне вывело несколько моих коммитов, и потом при нажатиии enter выходит ещё коммит, и так пока коммиты не закончатся. И даже после этого я не могу написать в гите другую команду, висит end. Приходится перезапускать git bash. Как выйти из лога коммитов?

Отслеживать
задан 19 фев 2016 в 21:05
jokelocker jokelocker
609 1 1 золотой знак 6 6 серебряных знаков 16 16 бронзовых знаков
19 фев 2016 в 21:10

5 ответов 5

Сортировка: Сброс на вариант по умолчанию

По-умолчанию Git посылает вывод своих комманд на программу-pager. По-умолчанию это программа less. Выйти из less можно пятью способами: q , Q , : q , : Q и Z Z .

Отслеживать
ответ дан 20 фев 2016 в 3:20
11.7k 24 24 серебряных знака 38 38 бронзовых знаков
Примечание: не забудьте переключить раскладку! Русское Й не сработает как надо!
30 янв 2022 в 11:58

как и отовсюду комбинацией клавиш (это linux) CTRL + Z

На виндовом клиенте не работает , поэтому что бы прекратить скрол нажмите q

Отслеживать
ответ дан 19 фев 2016 в 21:09
1,668 10 10 серебряных знаков 15 15 бронзовых знаков

CTRL + Z не выходит из программы, a приостанавливает программу и посылает ее в фон (вернуть ее обратно можно с помощью команды fg).

Linux shell scripting error for double quotes sentence closing [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.

This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.

Closed last month .
When I execute a script in a Linux shell, I get this output:

dquote> 

What does this mean?
asked Apr 2, 2013 at 20:00
1,599 2 2 gold badges 9 9 silver badges 7 7 bronze badges

11 Answers 11

It means you’ve executed a line of code with only one double-quote character, like this:

echo "Hello 

The shell is waiting for the other quote.

answered Apr 2, 2013 at 20:02
RichieHindle RichieHindle
275k 47 47 gold badges 360 360 silver badges 402 402 bronze badges

And I found that CTRL+G was the only way to undo my command. As entering » will execute something you maybe had mistyped.

Jun 27, 2017 at 14:05
I was working in MobaXTerm w/ OhMyZSH shell and this worked perfectly for me.
Jun 29, 2017 at 21:07
This worked for me. Just added one more » and pressed enter.
Jun 15, 2019 at 0:39

This can also occur in those cases when you use two different type of quotation mark. Therefore it’s worth to replace the quotation marks if you copied the command from somewhere else on the net.

Sep 7, 2021 at 6:45

@PierreMaoui — you should add your as a full-blown answer, as it’s the safest way to get out of the situation, and it’s easy to miss here in the comments. (And thanks for pointing it out — was exactly what I needed!)

Jan 21, 2022 at 20:11

If you have an ! in a quoted string like password=»this1smyp4ssword!» it will also end with dquote>

answered Dec 13, 2020 at 12:29
Rico Neitzel Rico Neitzel
1,206 10 10 silver badges 9 9 bronze badges

What shell and what version are you using. I either get an error in [email protected] or it gets ignores in [email protected] The comment might be outdated, but I’m not sure

Dec 16, 2020 at 14:32
I’m using zsh 5.7.1 (x86_64-apple-darwin19.0)
Dec 17, 2020 at 15:16
This is because of history expansion being enabled and can be escaped with a backslash, \!
Jul 30, 2021 at 10:48
That was exactly my case.
Jan 25, 2022 at 17:54
@skytwosea I found that if you do password=»this1smyp4ssword\!» , it will not do dquote
Oct 2, 2023 at 18:31

When you have «dquote>» on terminal, do not worry just press double quotes button on keyboard for EXIT:

Screenshot example:

enter image description here

answered Jan 30, 2021 at 22:04
canerkaseler canerkaseler
6,712 46 46 silver badges 40 40 bronze badges

The shell is waiting for the other quote of an unfinished command.

CTRL+G will leave that state and undo the command.

Entering » and pressing enter is an other way to leave but it will execute something you may had mistyped.

answered Jan 29, 2022 at 15:20
Pierre Maoui Pierre Maoui
6,076 2 2 gold badges 28 28 silver badges 29 29 bronze badges
yes, this is the best way to solve the problem.
Aug 23, 2022 at 16:42

This is the best answer — works for other modes (i.e. not just dquote but also cmdsubst , for , etc, where you might not know how to close it); doesn’t execute the command you almost certainly wish to cancel; and works in most shells!

Nov 11, 2023 at 0:20

If we have an exclamation symbol in the password, for example like password=»passwordhas!symbol» it will also end with dquote>

To get rid of dquote , use a single quote, as shown below. password=’passwordhas!symbol’

answered Jan 28, 2021 at 3:22
Gangadhar Reddy Gangadhar Reddy
51 1 1 silver badge 3 3 bronze badges
or escape the exclamation: \!
Jun 13, 2023 at 4:10

dquote> 

The above prompt surely means that you have to de-quote the starting of the quote, i.e. » , with another quote: » .

Please write a letter i.e another: » in the dquote> prompt.

1,272 1 1 gold badge 16 16 silver badges 27 27 bronze badges
answered May 7, 2020 at 13:29
Rudhisundar Beura Rudhisundar Beura
41 2 2 silver badges 5 5 bronze badges

It might mean that you have escaped the ending double quotes while running the command. like:-

echo "Hello\" 

So you need to provide one more double quote.

answered Jun 13, 2022 at 10:29
978 2 2 gold badges 11 11 silver badges 32 32 bronze badges

You need to use a pair of double quotes in your text.

The shell is waiting for you to add a second double quote » , hence the prompt dquote> . Add and this prompt will go away.

The same applies for single quotes ‘

25 6 6 bronze badges
answered May 2, 2022 at 0:50
21 2 2 bronze badges

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

May 3, 2022 at 3:28

This just happened to me and when I typed « and pressed enter, it led to > being shown. If this happens to you, just press control-c

answered Apr 27, 2023 at 18:40
71 5 5 bronze badges

NB: check the double quotes in your line are ordinary ASCII double quotes.

I had a command cut from an e-mail, and was getting the ‘dquote>’ prompt. It turns out the text editors had replaced the final double quote with a double backquote, which can look almost identical. If in doubt, delete and retype all double quotes.

answered Dec 3, 2021 at 9:58
Richard Kirk Richard Kirk
301 2 2 silver badges 14 14 bronze badges

You need to use single quotes instead of double quotes and make sure they are closed.

«Hello» should be ‘Hello’

‘Hello should be ‘Hello’

answered Apr 8, 2023 at 11:37
Chris Claude Chris Claude
1,093 14 14 silver badges 26 26 bronze badges

What do you mean by this? The OP hasn’t shared anythign that contains quotes, and there are already other answers mentioning quotes. Please do not duplicate them, unless you want to share new insights

Apr 8, 2023 at 11:40

@NicoHaase You misunderstood my answer. There’s no answer that mentions you should use single quotes when double quotes are not working. In my case my double quotes matched but was still giving the issue. Changing them to single quotes worked

Apr 8, 2023 at 12:03

Feel free to add all clarification to your answer by editing it. Using matchin pairs of quotes has already been recommended in the other answers. What do you want to add to them?

Apr 8, 2023 at 18:17

Highly active question. Earn 10 reputation (not counting the association bonus) in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.

  • linux
  • shell
  • quotes

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *