0

Currently my shell script shows as below and I need to write equivalent in windows bat I am new to this tried little bit but not sure it is correct. Please help

Shell script:

 ./SetDate.sh $1
 until [[ $currentDate -eq $endDate ]] ; do

while read myline
do
    currentDate=$myline
done < currentDate.txt

    echo "The current date being processed is: " $currentDate 

# Invoke one day activity 
./OneDay.sh $currentDate

export ReturnCode=$?
if  [ ${ReturnCode} -ne 0 ];then
     echo "Running jobs failed. For more details see log files."
fi

# Go to the next day
./GetDate.sh
 done   

Tried half the way in windows but not sure. Please help on this equivalent in windows bat.

until [[ %currentDate% EQ %endDate ]] ; do 

while read myline; 
do 
    currentDate = %myline% 
done <<currentDate.txt 

call OneDayActivity.bat %currentDate% 
set returnCode=%ERRORLEVEL% 
IF "%returnCode%" NEQ "0" ( 
  echo "Running jobs failed. For more details see log files." 
) 
call GetDate.bat 
:EOF

Thanks

jeb
  • 78,592
  • 17
  • 171
  • 225
testprabhu
  • 63
  • 1
  • 8
  • 1
    You should show your translated part – jeb Jan 20 '16 at 09:38
  • Hi please find my translated part not sure correct please help me on thisuntil [[ %currentDate% EQ %endDate ]] ; do while read myline; do currentDate = %myline% done < – testprabhu Jan 20 '16 at 10:14
  • 2
    The key part of your question seems to be _“How to write `while` or `until` in batch file?”_ https://stackoverflow.com/questions/1788473/while-loop-in-batch – Melebius Jan 20 '16 at 11:31
  • Hi yes I am still confusion how to write while or until. Please help me on this. – testprabhu Jan 20 '16 at 12:47
  • There is no native `while` nor `until` in `cmd`/batch; so you have to work around this using `if` and `goto`; the logic how to combine that should not be too difficult... – aschipfl Jan 20 '16 at 19:07

0 Answers0