Silly question about bash

the_servicer

2[H]4U
Joined
Aug 16, 2013
Messages
2,094
When I enter a single apostrophe on a command line, I get a greater than sign as output.

In other words, entering
Code:
'
yields the following
Code:
>

Why?
 
Because bash is looking for the closing quote in the input and you hit Enter before inputting the second quote. The ">" is bash's way of saying "I'm looking for the rest of the command".

If you are trying to input a single quote on purpose, like entering the word "don't" on the command line, you'll need to escape the quote with a backslash: "don\'t" and bash won't try to go looking for a closing quote.
 
Back
Top