What's the ^ command line symbol for?

  • Thread starter Thread starter andrea@NOSPAMPLEASE.com
  • Start date Start date
A

andrea@NOSPAMPLEASE.com

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
 
[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
 
<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.
 
Back
Top