Помогите с переводом скрипта под Linux
:loop
del /q "world\*"
set "d=C:\Users\User\!replace\world"
setlocal enabledelayedexpansion
for /f "delims=" %%r in ('dir /ad/b "%d%"') do set "$d_!random!=%%r"
for /f "tokens=2 delims==" %%d in ('set $d') do set "p=%d%\%%d"
>nul xcopy /i "%p%\*" "world"
endlocal
pause
goto loop