Shell basic combat

Learning environment: Ubuntu

  How to check the system version: [# cat /proc/version]

1. for loop exercise

  1.1 Batch generation of random character file name cases

  Experimental purpose: Generate 10 randomly generated txt texts in the /learning path, and the file name contains 10 lowercase letters plus the fixed field "_gen".

yum info pwgen &>/dev/null
if [ $? -eq 1 ]
    then
    apt-get install pwgen -y &>/dev/null
be

cd /clsn &&\
for i in {1..10}
    do
    #File_Name=`uuidgen | tr "0-9-" "a-z"|cut -c 1-10`
    File_Name2=`pwgen -1A0 10`
    touch ${File_Name2}_clsn.html
done
View Code

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325023849&siteId=291194637