`

add more users

阅读更多

#!/bin/bash

# addclass ga 1 50  username ga0101-ga0150

groupadd users 2>> /dev/null
if [ $? -eq 0 ]
then
echo "Users is created seccussfully !"
else
echo "Users is exist,you needn't created !"
fi
grade=$1
num_class=`expr $2 + 0`

if (test $num_class -le 9)
    then
num_class="0"$num_class
fi

max_stid=`expr $3 + 0`
num_stid=1

if [ ! -x /home/student ]
then
mkdir /home/student
fi

if [ ! -x /home/student/$1$num_class ]
then
mkdir /home/student/$1$num_class
fi

while (test $num_stid -le $max_stid)
do
if (test $num_stid -le 9)
then
num_stid="0"$num_stid
fi
user_name=$grade$num_class$num_stid
echo $user_name":"$user_name >> user_pwlist
adduser -g users -d /home/student/$1$num_class/$user_name $user_name
#setquota -u $user_name 10240 20480 0 0 /home
chmod 755 /home/student/$1$num_class/$user_name
num_stid=`expr $num_stid + 1`
done

chpasswd < user_pwlist
pwconv
/bin/rm -f  user_pwlist

分享到:
评论

相关推荐

    Windows MicroXP 0.82[Microsoft Windows XP SP3原版加工成的微型XP系统,=99.9%个完整XP]

    Do not try to add more users, otherwise your main account that is used by default (Administrator) will become the new account and after logging in, you will not have any desktop theme (not even ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: When the curve contain more then one figure and they were all unconfined and curve have alternative brush then whole flex-object bounding rectangle was filed. - FIX: The MaskColor property ...

    Learning Facebook Application Development.pdf

    Using Facebook applications, ...The book covers how to send notifications and invitations from within an application, update a user's profile, create application control panels for users, and much more.

    linux_starter_pack

    navigate around the desktop, use common software, add more programs and fix any problems you may encounter. It's based around a slightly older version of Ubuntu Linux so there may be some minor ...

    Python for DevOps Learn Ruthlessly Effective Automation.pdf

    Devops, the combination of software development with... Once you have these core concepts down, you can add more complicated tools, and indeed this is touched in more advanced features in later chapters.

    Programming.Microsoft.Office.365.epub

    You’ll learn how to use the new Microsoft Graph API to integrate users’ mail, calendars, contacts, groups, files, folders, and more. Leveraging Microsoft APIs at the REST level, you’ll discover ...

    好压免费软件

    9 to add more common sub-volume sizes and the number of custom sub-volumes to six, giving the user more choice; 10 New well pressure the main interface title bar text display switching function; 11 ...

    pdf修改软件

    With this new version, users can easily add a simple shape in the main interface of Foxit PDF Editor without having to enter into the graphics editor. 4. Removing all evaluation marks at once ...

    ExpressPrinting System Suite v2.4.7 for Delphi 7

    It gives you the power to quickly add unlimited reporting to your programs without designing a single report! When you combine the ExpressPrinting System with the ExpressQuantumGrid or ...

    Developing Large Web Applications: Producing Code That Can Grow and Thrive

    * Avoid common coding and maintenance headaches as small websites add more pages, more code, and more programmers * Get comprehensive solutions for refining HTML, CSS, JavaScript, PHP, and Ajax for ...

    Twitter Tips, Tricks, and Tweets

    If you’re one of the millions of users joining Twitter to connect to friends, family, and interest groups; or to follow the conversation and find out what’s happening beyond your doorstep, then this...

    HPE OmniStack 3.7.8 for vSphere Deployment Guide

    As capacity and performance needs increase, you can add more HPE OmniStack hosts without disruption to users. This network of hosts is called an HPE SimpliVity federation. Once you deploy HPE ...

    SnagIt v11.2.1.72 + Serials

    Add visuals to your documentation What if all your documentation was quick to create, simple to update, and easy for users to follow? With Snagit, it only takes a few clicks to keep graphics current. ...

    Large Scale and Big Data Processing and Management.pdf

    Internet users reached 2.27 billion in 2012. Every day, Twitter generates more than 12 TB of tweets, Facebook generates more than 25 TB of log data, and the New York Stock Exchange captures 1 TB of ...

    Three.js Cookbook(PACKT,2015)

    Modern browsers are ...By the end of the book, you'll be able to quickly add advanced features to your scene, improve the way users interact with your 3D scene, and make your scenes look stunning.

    addin

    then ...&lt;P&gt; For more information the Security Add-In please click here or read the help file that is distributed with the wizards. &lt;P&gt; 2) Global Error Handler &lt;BR&gt; Error handling is a necessary evil ...

    IME编程例子

    IME level 3 is more convenient and powerful for East Asian users. You can create a custom control or window that supports IME level 3 using this sample. This sample determines the font and code ...

    statusnet源程序

    you can add more!). Users can choose which people to "follow" and receive only their friends' or colleagues' status messages. It provides a similar service to sites like Twitter, Google+, Facebook or ...

    Monetizing Machine Learning--2018

    Build an intuitive and useful recommendation site to add value to users and entice them to keep coming back Utilize the freemium offerings of Google Analytics and analyze the results Take your ...

    X-Frame FPS Accelerator v3.5

    X-Frame, although customizable, has been designed to work out-of-the-box, just add the main script to your camera and you will gain immediate FPS. You can customize: • the downsampling method (2 ...

Global site tag (gtag.js) - Google Analytics