using gam as bash shortcut

226 views
Skip to first unread message

rid donlot

unread,
Aug 1, 2022, 4:31:09 AM8/1/22
to GAM for Google Workspace
Hi there,

so I want to create simple script to ease our work, this command is optional to choose

=============================
#! /bin/bash

#mainmenu function
mainmenu () {
echo "this is gam tools shortcut, please choose below"
echo "Enter 1 to check user info"
echo "Enter 2 to check group description"
echo "Enter 3 to exit"
read selection
processtheselection
}

menu1()
{
echo "enter your email"
read user
gam info $user;
}

menu2()
{
echo "enter the group id or email";
}

exitapp()
{
echo "Exiting from the Application"
exit;
}

processtheselection()
{
case $selection in
    1) echo "you will create user, type below"
        menu1
        mainmenu
      ;;
    2)  echo "you will check group description"
        menu2
        mainmenu
      ;;
    3) exitapp
        echo "exit..."
        exit
      ;;

esac
}

mainmenu;

=============================

when I'm choose the menu, the gam command was not work.

example when I choose menu 1 that call the command "gam info user"
this will show prompt our email to input

you will create user, type below
enter your email
xxxxx @ gmail .com (sample email)
./gamtest.sh: line 29: gam: command not found << this error that I need more information

thank you before

Ross Scroggs

unread,
Aug 1, 2022, 9:55:23 AM8/1/22
to google-ap...@googlegroups.com
Add the following line after #! /bin/bash
gam="/path/to/gam/executable"
e,g,: gaM="/Users/admin/bin/gam/gam"

Use $gam wherever you run gam.
e.g.: $gam info $user

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/bfcf8abb-70f0-4435-bc22-c1c7939aa0dfn%40googlegroups.com.

rid donlot

unread,
Oct 12, 2022, 12:59:22 AM10/12/22
to GAM for Google Workspace
thanks rose, it works
Reply all
Reply to author
Forward
0 new messages