Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

after executing grep '19-12-2008 without ending the quote.i got stuck with > in command line how to exit

share|improve this question
    
what shell are you using? –  Nathan Fellman Oct 21 '09 at 11:24
add comment

migrated from stackoverflow.com Oct 23 '09 at 3:29

This question came from our site for professional and enthusiast programmers.

3 Answers

End it by closing your quote (i.e. typing another apostrophe).

Or, if you've changed your mind and you don't want to execute the command any more, ctrlc will get you out of the command and back into the shell.

share|improve this answer
add comment

Just CTRL-C and start again, or type in 'ENTER on the next line. The prompt you're seeing (>) is because you haven't finished the command - the shell thinks you wanted that linefeed within a string and it's waiting for you to close that string with another quote.

share|improve this answer
    
At least with bash/grep, it's not treating the linefeed as a literal. echo -en hi | grep 'h ' (with single or double quotes, and with newlines instead of spaces) both pick up the hi. If you actually put spaces in the quotes, it does not pick up the hi. –  Mark Rushakoff Oct 21 '09 at 11:27
    
Interesting, that must be a grep feature - it works with grep 'h<lf>i' but echo outputs it as I expected, with an embedded linefeed. –  paxdiablo Oct 21 '09 at 12:15
add comment

escape your quotation mark with a backslash

$ grep \'19-12-2008
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.