码迷,mamicode.com
首页 > 系统相关 > 详细

shell脚本面试题

时间:2016-03-04 14:41:12      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:shell脚本面试题

技术分享

#!/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脚本面试题

标签:shell脚本面试题

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!