In Windows 10, a shell script is replaced with an implementation of a php script (execute a php script from another php script)
1. Reference: Run the .sh or shell script files in WSL in Windows 10. Since the .sh file is run, all environment configurations in the file must depend on the configuration items in Ubuntu. But the environment configuration in Ubuntu is not perfect. Decided to replace the shell script with php script
2. The code implementation of the shell script is as follows
#!/bin/sh
for i in $(seq 1 200);
do
echo "Install theme $i times"
php artisan theme-store-db:theme:install C:/Users/Lenovo/Downloads/theme "theme$i" blade --force
done
The current requirement is that you need to execute the PHP command line in a PHP script
4. Execute the command: php themes.php, the execution is successful. as shown in Figure 1
PS E:\wwwroot\object> php themes.php
Install theme 1 times
Install theme 2 times
Install theme 3 times
Install theme 4 times
Install theme 5 times
5. Confirm the execution result and check the data written in the database, which is in line with expectations. as shown in Figure 2

