LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what does \ do in a command? (https://www.linuxquestions.org/questions/linux-newbie-8/what-does-%5C-do-in-a-command-210637/)

jedimastermopar 07-28-2004 11:05 AM

what does \ do in a command?
 
You know how when you at the cli, and you type in a command and hit enter? well sometimes I hit the \ key as well as enter and it drops down to another line that starts with a ?. What is the function of that?

Dark_Helmet 07-28-2004 11:43 AM

You use the backslash-enter key sequence to tell the shell you are giving it a multi-line command. The line starting with the question mark is just the shell's way of saying "Ok, gotcha... you need another line. Here's a very simple prompt so you can continue."

qwijibow 07-28-2004 12:12 PM

backslash is a special key, its use means take the next key as its ascii value, NOT its assigned function..

for example. in C++.. here is a hello world program.

cout << "Hello World";

but what if you wanted cout to print the character [ " ]

cout << " She said "You Smell !" ";
COMPILE error. !!!!

so you would use

cout << " She said \"You Smell !\" ";

the same thing is used to put spaces in file names (in command line)

jedimastermopar 07-28-2004 12:21 PM

Ahh i gotcha thanks. :)


All times are GMT -5. The time now is 02:40 AM.