I'm a complete noob when it comes to anything Windows related, so I'm hoping this is an easy question for someone. I'm using Win7 if it makes a difference.
I have the following code in a .cmd file which I run twice in a row from the command line which produces the following output:
set /p input_tmp=input something: || set input_tmp=default
echo "input_tmp outside if: %input_tmp%"
if "%input_tmp%"=="default" (
echo "input_tmp inside if: %input_tmp%"
)
-------------output 1---------------
input something: cat
"input_tmp outside if: cat"
-------------output 2---------------
input something: dog
"input_tmp outside if: dog"
However, when I run the following code...
if not "%~1"=="something" (
set /p input_tmp=input something: || set input_tmp=default
echo "input_tmp outside if: %input_tmp%"
if "%input_tmp%"=="default" (
echo "input_tmp inside if: %input_tmp%"
)
)
-------------output 1---------------
input something: cat
-------------output 2---------------
input something: dog
"input_tmp outside if: cat"
Being a Java programmer for Linux ...this confuses the begezus out of me.