Shell scripts are designed to help us focus on certain things. Instead of us doing it. To some extent, it does bring us great convenience. Here is a script that performs a bulk copy paste file. first, the use of the scene
When the app is upgraded, you need to change the version number under the corresponding project. If there are more projects, it would be too much trouble to make a single change, so it is imperative to write a shell script. Second, Shell script parsing
1, first is the directory of files
2, script content
This represents the assignment of WX and API
wx= "ENV_FILE_WX"
api= "Env_file_api"
//using touch to create the file, ${} is the prototype of the variable, specific reference to the link below.
Touch ${wx}
${api}
//cp means copy, represent replication env file, and copy to ENV_FILE_WX and ENV_FILE_API
CP Env ${WX}
CP Env ${api}
//mv is the meaning of the move, representing the move ${wx} to the PZWX directory, overwriting if the. env file exists, and without prompting
///If prompted, use mv-i ${wx} pzwx/.env
//execute this command, when the overlay will pop-up prompts
MV ${wx} pzwx/.env
mv ${api} pzapi/.env
//echo is the output meaning, Direct output to our small black box
echo "Move ${wx} ${api} successfully"
3, the shell script in the various brackets interpretation:
Http://www.jb51.net/article/60326.htm
For specific explanations, refer to the comments section of the script. Shell scripts are pretty common, and you have a chance to learn.
End