Jump to content

What's the ^ command line symbol for?


Recommended Posts

Guest andrea@NOSPAMPLEASE.com
Posted

Hi all,

I have a question about the Windows command line interpreter:

 

The ? symbol replaces one character with boolean true, the * symbol replaces

one sequence of characters with boolean true, but what does the ^ symbol do?

 

Just try to run these commands and you'll see it must have a special meaning:

ECHO ^

ECHO ^^

ECHO ^^^

ECHO ^^^^

 

same on filenames. If a file contains ^ in its name, I am forced to specify

it between quotes even if it doesn't contain any space!

 

Thanks,

Andrea

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest Ayush
Posted

Re: What's the ^ command line symbol for?

 

[andrea@NOSPAMPLEASE.com] wrote-:

> Hi all,

> I have a question about the Windows command line interpreter:

>

> The ? symbol replaces one character with boolean true, the * symbol replaces

> one sequence of characters with boolean true, but what does the ^ symbol do?

>

> Just try to run these commands and you'll see it must have a special meaning:

> ECHO ^

> ECHO ^^

> ECHO ^^^

> ECHO ^^^^

>

> same on filenames. If a file contains ^ in its name, I am forced to specify

> it between quotes even if it doesn't contain any space!

 

^ is the escape char. For example, if you want to echo "&", you cannot run:

Echo &

because & is a special char to separate commands. But you can use ^ char to escape it:

Echo ^&

 

Good Luck, Ayush.

--

XP-Tips [Adjust the vertical space between icons] :

http://www.microsoft.com/windowsxp/using/setup/tips/iconspace.mspx

Guest Pegasus \(MVP\)
Posted

Re: What's the ^ command line symbol for?

 

 

<andrea@NOSPAMPLEASE.com> wrote in message

news:46a0b27d$0$10625$4fafbaef@reader2.news.tin.it...

>

> Hi all,

> I have a question about the Windows command line interpreter:

>

> The ? symbol replaces one character with boolean true, the * symbol

> replaces

> one sequence of characters with boolean true, but what does the ^ symbol

> do?

>

> Just try to run these commands and you'll see it must have a special

> meaning:

> ECHO ^

> ECHO ^^

> ECHO ^^^

> ECHO ^^^^

>

> same on filenames. If a file contains ^ in its name, I am forced to

> specify

> it between quotes even if it doesn't contain any space!

>

> Thanks,

> Andrea

>

 

Not only is ^ the escape character but it is also the line continuation

character. When you type

echo ^

then Windows expects to get a further line of text. Thus the lines

 

echo My name is ^

echo Andrea

 

will generate the line "My name is Andrea" on the screen.


×
×
  • Create New...