#!/bin/bash
#create user* and chang group to users
#by wangyq 2017
groupadd users
for i in `seq -w 0 99`
do
useradd -g users user_$i;
done
#create user* and chang group to users
#by wangyq 2017
groupadd users
for i in `seq -w 0 99`
do
useradd -g users user_$i;
done
useradd -g users user_$[$i+1]
由于seq -w是让序列等宽,所以到0-100 会显示000 001...100
#两种直接0-100实现方式
seq -f "%02g" 0 100 /00 01 02 …100
seq -w 0 100 | sed 's/^0//' /00 01 02 …100