[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.