#!/bin/sh -x USER=ubuntu DEFGROUPS="sudo" echo "I: add $USER to ($DEFGROUPS) group(s)" usermod -a -G ${DEFGROUPS} ${USER}