#!/bin/bashif [ ! -d /rhome&"/>

shell脚本面试题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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脚本面试题的主要内容,如果未能解决你的问题,请参考以下文章