Wednesday, October 04, 2006

將 geeko的quota policy assing給uid大等於1000的user

#!/bin/bash

for VAR in `cut -d: -f3 /etc/passwd`
do
declare -i VAR
if [ "$VAR" -ge 1000 ]; then
cat /etc/passwd | grep "$VAR" >> /tmp/userlist
fi
done

for VAR2 in `awk -F: '{print $1}' /tmp/userlist`
do
#echo $VAR2
edquota -p geeko "$VAR2"
done

rm /tmp/userlist

PS 雖然可以work,還有點缺點 。

No comments: