您的位置:首页 > 运维架构 > Shell

shell脚本面试题

2016-03-04 12:25 921 查看



#!/bin/bash
if [ ! -d /rhome ]
then
mkdir -p /rhome
fi
continue
uid=1000
for i in `seq 1 30`;do
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  脚本 shell 面试题