摘要: 1 #!/bin/bash 2 #By spinestars 3 #2013-8-16 4 5 read -p "请输入下载目录路径" down_dir 6 read -p "请输入网址路径" url 7 #判定下载文件是否存在 8 file_d(){ 9 if [ $? -eq 0 ];then10 echo "下载成功"11 else12 echo "错误:下载失败"13 exit 5214 fi15 }16 17 #判定目录是否存在,不存在则提示是否创建18 if [ -d $down_dir ];then1 阅读全文
posted @ 2013-08-16 17:52 星空刺 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1 #!/bin/bash 2 #By spinestars 3 #2013-8-16 4 #cksum5位数获取方法,可能有重复 5 #pd="user`head -200 /dev/urandom | cksum | head -c 5`" 6 7 #php获取5位随即数字 8 pd_num_php(){ 9 /bin/php -q 14 EOF15 }16 17 #user函数判定用户是否存在,不存在就创建账户18 user(){19 awk 'BEGIN{FS=":"}{print $1}' /etc/passwd | grep 阅读全文
posted @ 2013-08-16 17:28 星空刺 阅读(223) 评论(0) 推荐(0) 编辑