Shell script creation file, auto copy paste file __shell

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.