Escape characters using ^ Caret symbol
^ Caret symbol is used to escape special characters in string of ms dos commands. For example > is used to write output to the file but > has to print with the echo command. But it is not escape by echo command because > is used to write echo output to the file.
echo welcome > filename.txt
It writes welcome to the file.
echo a > b means a is big > filename.txt
It write only a to the file. because > has different meaning in the command line. so > has to escape with ^ caret symbol like below.
Valid statement with caret escape character symbol.
echo a ^> b means a is big > filename.txt
also escape < less than symbol also with ^ caret symbol
echo ^<script^> > hello.html
To escape % symbol in batch file is %%. %% percentage is equals to single %.
|
Example batch file program
@echo off
echo a is big, which means
echo a ^> b is the expression to test which is big among two numbers.
|