Convert Linux script
Posted: 21 Dec 2019 23:51
I have a Linux script that I got to work on Ubuntu but I need the same script to run on Windows. The main bit from the Linus script is
I have tried a bunch of things but I do not know the syntax in Windows. This is what I eventually had:
but it gives an error message
Code: Select all
n=100;
max=200;
while [ "$n" -le "$max" ]; do
echo "$passwd"> /usr/bin/multiboinc/BOINC_"$n"/gui_rpc_auth.cfg;
echo "BOINC_$n $passwd";
n=`expr "$n" + 1`;
done
Code: Select all
set /P passwrd=aussie
echo $passwrd
FOR /L %X IN (100,1,102) DO (
break> /mnt/c/multiboinc/BOINC_"$n"/gui_rpc_auth.cfg;
echo $passwd> C:\multiboinc\BOINC_$X\gui_rpc_auth.cfg
echo BOINC_$X
X=`expr $X + 1`)
DONE
C:\multiboinc>passwd_change.bat
C:\multiboinc>set /P passwrd=aussie
aussie
C:\multiboinc>echo $passwrd
$passwrd
C:\multiboinc>set /A X=0
X was unexpected at this time.
C:\multiboinc>FOR /L X IN (100,1,102) DO (