Shell: 生成随机字符串
摘要:
生成一个二十位的随机字符串:#!/bin/bashrandstr() { index=0 str="" for i in {a..z}; do arr[index]=$i; index=`expr ${index} + 1`; done for i in {A..Z}; do arr[index]=$i; index=`expr ${index} + 1`; done for i in {0..9}; do arr[index]=$i; index=`expr ${index} + 1`; done for i in {1..20}; do str="$str${ 阅读全文
posted @ 2012-11-24 10:48 Sheldon Xu 阅读(5889) 评论(0) 推荐(1) 编辑