首页 > 系统服务 > 详细

shell脚本面试题

时间:2016-03-04 14:39:17      阅读:222      评论:0      收藏:0      [点我收藏+]

技术分享

#!/bin/bash
if [ ! -d /rhome ]
then 
mkdir -p /rhome
fi
continue
uid=1000
for i in `seq 1 30`;do
echo $dir
if [ $i -lt 16 ]
then
useradd -d /rhome/user$i -s /bin/bash user$i -u $(($uid+$i))
echo "redhat|passwd user$i --stdin"
elif [ $i -gt 15 ]
then
useradd -d /rhome/user$i -s /sbin/nologin user$i -u $(($uid+$i))
echo "redhat|passwd user$i --stdin"
fi
done


本文出自 “boyhack” 博客,请务必保留此出处http://461205160.blog.51cto.com/274918/1747525

shell脚本面试题

原文:http://461205160.blog.51cto.com/274918/1747525

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!