Hi,
First thank you for your posts. It helps a lot. And sorry for my bad
knowledges in unix scripts.
Here my final script that i will use :
if [ $1 ] & [ $2 ]; then
tempfile=`mktemp /tmp/tempfile.XXXX`
cp /etc/group $tempfile
onlygroup=`mktemp /tmp/tempfile.XXXX`
cat $tempfile | grep ^$2 > $onlygroup
nogroup=`mktemp /tmp/tempfile.XXXX`
cat $tempfile | grep -v ^$2 > $nogroup
cat $onlygroup | sed "s/$1//g" | \
sed "s/ /,/g" | sed "s/,,/,/g" | sed "s/,$//g" >> $nogroup
install -o root -g wheel -m 644 $nogroup /etc/group
rm -f /tmp/tempfile.????
else
echo "Remove user from a group"
echo "Use : sh duig user group"
fi
Cheers,
Wesley MOUEDINE ASSABY
www.mouedine.net