Shell script to create 10 HTML files in bulk with random lowercase 10 letters and fixed string Oldboy under the specified directory.

Source: Internet
Author: User

[Email protected] wyb]#CatTest10.SH #!/bin/bash# using the For loop/test10 directory 10 HTML files are created in bulk by random lowercase 10 letters plus a fixed string Oldboydir=/root/wyb/test10/[  ! -D $dir] &&mkdir-P $dir forIinch`seq Ten` Do  Touch$dir`Echo$RANDOM |md5sum|Cut-C1-Ten' _oldboy.html Done[email protected] wyb]# bash test10.SH[email protected] wyb]# CD Test10[[email protected] test10]#ls3fb16229e0_oldboy.html 5bf08cf5ce_oldboy.html 73e073e1e6_oldboy.html 860bafa69b_oldboy.html c0b0067928_ oldboy.html512c517124_oldboy.html 7245bf5bea_oldboy.html 76f98bef45_oldboy.html 94a1245d85_oldboy.html F37ace5e6a_ Oldboy.html[[email protected] test10]#

[Email protected] wyb]#CatXiugai.SH #!/bin/bash# Changes the file Oldboy in the test10 directory to Oldgirl (implemented with a For loop), and the HTML is changed to uppercase. #3fb16229e0_oldboy. html 5bf08cf5ce_oldboy.html 73e073e1e6_oldboy.html 860bafa69b_oldboy.html c0b0067928_ oldboy.html#512c517124_oldboy.html 7245bf5bea_oldboy.html 76f98bef45_oldboy.html 94a1245d85_oldboy.html f37ace5e6a _OLDBOY.HTMLCD test10 forIinch`ls`  Doa=`Echo$i |Cut-C1-Ten`   MV${a}_oldboy.html ${a}_oldgirl. HTML Done[email protected] wyb]# bash Xiugai.SH[email protected] wyb]# CD Test10[[email protected] test10]#ls3fb16229e0_oldgirl. HTML 5bf08cf5ce_oldgirl. HTML 73e073e1e6_oldgirl. HTML 860bafa69b_oldgirl. HTML C0b0067928_oldgirl. Html512c517124_oldgirl. HTML 7245bf5bea_oldgirl. HTML 76f98bef45_oldgirl. HTML 94a1245d85_oldgirl. HTML F37ace5e6a_oldgirl. Html[[email protected] test10]#

Shell script to create 10 HTML files in bulk with random lowercase 10 letters and fixed string Oldboy under the specified directory.

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.