标签: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脚本面试题
原文地址:http://461205160.blog.51cto.com/274918/1747525