#!/bin/bash
x=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 # 定义字典
pass=''
for i in {1..8}
do
num=$[RANDOM%62] #随机生成一个字符
tmp=${x:num:1}
pass=${pass}$tmp #定义字符叠加
done
echo $pass
8位随机密码生成功能实现运行脚本可实现生成一组8位随机的密码#!/bin/bashx=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 # 定义字典pass=''for i in {1..8} donum=$[RANDOM%62] ...