LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is ">" in console? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-in-console-817944/)

Mr. Alex 07-04-2010 05:55 AM

What is ">" in console?
 
When ">" appears below recent command and you can type there - what is it? Where to read about it?

pr_deltoid 07-04-2010 05:57 AM

It's stored in a variable called PS2. It's the second prompt.
http://www.davidpashley.com/articles/bash-prompts.html
Quote:

PS2 is the continuation prompt

AnanthaP 07-04-2010 07:23 PM

Means that as far as the shell is concerned, you didn't complete the previous command. Usually happens in development of awk, sed and other scripts when you leave out a bracket (parentneses). To come out, type a ";" (semi-colon) and review what you typed earlier.

OK

Mr. Alex 08-18-2010 10:12 AM

Quote:

To come out, type a ";" (semi-colon) and review what you typed earlier.
Try:
Code:

echo 'hello"
You won't be able to exit with ";".

sem007 08-18-2010 10:18 AM

it is PS2 prompt. When you breake command using \ it will display ">" prompt

and when you complete command whole command will execute.

i.e

Code:

echo "Hello friends \
> how are you?"

hello friends how are you?


chrism01 08-19-2010 04:39 AM

As mentioned, typically its the the 2ndary prompt eg if you have unmatched quotes (post #4) it's saying you need to close the quotes before it will action the cmd.
If you are good, you can write+run a shell script on the fly without creating a shell file eg
Code:

[name@host:/path]$ for file in `*.dat`
>do
>grep pattern $file
>done
[name@host:/path]$



All times are GMT -5. The time now is 07:36 AM.