The code is as follows:
1#!/bin/SH2 #################################################################3 # Author:91coder4# blog:www.cnblogs.com/91coder5 #################################################################6 7 # Create a directory8path=/91coder9[-D"$Path"]||mkdir-P $PathTen One # Create a file A forNinch`seq Ten` - Do -random=$ (OpenSSL rand-base64 +|sed 's#[^a-z]# #g'|Cut-C2- One) the Touch$Path/${random}_91coder.html - Done
Operation Result:
1[Email protected] ~]# ll/91coder/2Total03-rw-r--r--.1Root root0Feb4 -:Wuyidgyelwxmgt_91coder.html4-rw-r--r--.1Root root0Feb4 -:Wuyiigcaczxyun_91coder.html5-rw-r--r--.1Root root0Feb4 -:Wuyiitrwznpytf_91coder.html6-rw-r--r--.1Root root0Feb4 -:Wuyimnjzmclxrs_91coder.html7-rw-r--r--.1Root root0Feb4 -:Wuyindcbqhttit_91coder.html8-rw-r--r--.1Root root0Feb4 -:Wuyinexnbwzmak_91coder.html9-rw-r--r--.1Root root0Feb4 -:Wuyipobtynbzfe_91coder.htmlTen-rw-r--r--.1Root root0Feb4 -:Wuyistusewzwyn_91coder.html One-rw-r--r--.1Root root0Feb4 -:Wuyiwbmzcpugna_91coder.html A-rw-r--r--.1Root root0Feb4 -:WuyiZgmqeywark_91coder.html
Shell Utility case: Batch generation of random character filenames