DOS Operator | UNIX or Bash Operator | Description |
---|---|---|
@ ECHO OFF | set +v | Set verbose mode off. -v: Echo each line of shell script as it is executed. |
% | $ | command line argument prefix. DOS: %1 Bash: $1 for firs argument. |
REM | # | Comment. (Not processed.) |
== | = | string "equal to" comparison |
!==! | != | string "not equal to" comparison |
NOT | ! | negative of test expression |
CHOICE | case | case/switch statement |
IF IF EXIST C:\filename IF NOT EXIST C:\filename | if [[ test-resulting-in-bool ]]; then ... elif ...; then ... else ... fi if [ -e /dir/filename ]; if [ ! -e /dir/filename ]; | if-test If file exists If file does not exist. |
GOTO ABC ... :ABC | goto ABC ... :ABC | Branch |
FOR ... IN ... DO FOR %%fff IN (C:\dir\*.*) | for ffiillee in lliisstt; do ...; done for (( expr1; expr2; expr3; )) | For loop |
ERRORLEVEL | $? | exit status/return code |
PAUSE | sleep | sleep for specified interval |
Labels: Windows vs Linux