@echo off
rem Process the file given on the command line
setlocal enabledelayedexpansion
for /f "tokens=1,*" %%a in ('type %1') do (
set cmd=%%a
set line=%%b
call :_!cmd! !line!
)
goto:_slash_convert_end
:_slash_convert
SET ARGS=
:loop
if not "%1"=="" (
SET Z=%1
SET Z=!Z:$=%%!
SET Z=!Z:{=!
SET Z=!Z:}=%%!
SET ARGS=%ARGS%!Z:/=\!
shift
goto :loop
)
rem echo.%CD%^> %ARGS%
call %ARGS%
goto:eof
:_slash_convert_end
goto:cp_end
:_cp
call:_slash_convert copy %* && goto:eof
:cp_end
goto:cd_end
:_cd
call:_slash_convert cd %* && goto:eof
:cd_end
goto:mkdir_end
:_mkdir
if "%1"=="-p" shift
SET Z=%1
SET Z=!Z:$=%%!
SET Z=!Z:{=!
SET Z=!Z:}=%%!
SET ARG=!Z:/=\!
if not exist %ARG% mkdir %ARG%
goto:eof
:mkdir_end
goto:echo_end
:_echo
echo.%* && goto:eof
:echo_end
goto:export_end
:_export
setlocal
SET F1=%1
SET "!F1:/=\!"
endlocal
goto:eof
:export_end
goto:unzip_end
:_unzip
call:_slash_convert unzip %* && goto:eof
:unzip_end
goto:qmake_end
:_qmake
call:_slash_convert qmake %* && goto:eof
:qmake_end
goto:make_end
:_make
call:_slash_convert nmake %* && goto:eof
:make_end
rem Null commands
:_#
:_#/bin/bash
:_#!/bin/bash
goto:eof