Objective
Online collection, thank the old boy and the big God, often read their blog and video, script is absolutely their own pure hand, what shortcomings, but also please the Great God guidance. If you feel that there is a violation of the place, please contact me promptly, I immediately delete!!
Thanks again to the old boy, although did not report your class, but saw a lot of you out of the video and your blog. People should know how to be thankful, although not your students!
Part of the topic Link: http://oldboy.blog.51cto.com/2561410/1632876
In the/chbo/directory, bulk create a fixed string starting with 10 random lowercase letters. html file
[[email protected]]# Cat CREATE_CHBO.SH#!/BIN/SHRANDPW () {</dev/urandom tr-dc A-Z | head-c${1:-10};echo;} [!-D/CHBO]&& mkdir-p/chbofor i in ' seq 9 ' do result= ' RANDPW ' Touch/chbo/${result}_chbo.htmldone[[email Pro Tected]]# sh create_chbo.sh2 [[email protected]]# ls/chbo/arwyievjgn_chbo.html eoxtksdqhl_chbo.html JBTPVJADIA_CHBO . htmlbzkhbwtgmw_chbo.html hhrptuucgr_chbo.html mmfrghunuv_chbo.htmldldpbwhdfz_chbo.html ivfeekbiyf_chbo.html Uwqcaynijh_chbo.html
2. Rename the batch and change the CHBO in the above file to Chboy
[Email protected] mianshi]# sh chname.sh [[email protected] mianshi]# ls/chbo/arwyievjgn_chboy.html EOXTKSDQHL_CHBO y.html jbtpvjadia_chboy.htmlbzkhbwtgmw_chboy.html hhrptuucgr_chboy.html Mmfrghunuv_chboy.htmldldpbwhdfz_ chboy.html ivfeekbiyf_chboy.html Uwqcaynijh_chboy.html[[email protected] mianshi]# cat chname.sh #!/bin/shcd/chbofor F In ' LS *.html ' does mv $f ' echo $f |sed ' s#\ (. *\) _chbo.html#\1_chboy.html#g ' done
This article is from the "by The Knife" blog, please be sure to keep this source http://chboy.blog.51cto.com/9959876/1721946
Shell Common Scripts