now=$(date +"%Y_%m_%d")
echo "****Creating CSV File With User List****"
if [ -d "/Volumes/GoogleDrive/Shared Drives/fileName" ]; then
touch "/Volumes/GoogleDrive/Shared Drives/fileName/$now.csv"
~/bin/gam/gam print users > "/Volumes/GoogleDrive/Shared Drives/fileName/$now.csv"
echo "Success!"
else
echo "Computer says no!"
fi
echo "****Removing user1 and user2 from the CSV****"
if egrep -q -v "
us...@domain.com$"
"/Volumes/GoogleDrive/Shared Drives/fileName/$now.csv"; then
echo "user1 has been removed from the CSV!"
else
echo "user1 has not been removed from the CSV!"
fi
if egrep -q -v "
us...@domain.com$"
"/Volumes/GoogleDrive/Shared Drives/fileName/$now.csv"; then
echo "And that is user2 removed!"
else
echo "Something went wrong while trying to remove user2 from the CSV!"
fi