Bulk CSV processing not working in Big Sur/zsh?

70 views
Skip to first unread message

Jinglan Yao

unread,
Jun 29, 2021, 1:33:00 PM6/29/21
to GAM for Google Workspace
Hello,

I'm trying to bulk add contacts from a csv to a specific user's contacts list and add them to a label. I'm using the following command:

gam csv <path to file.csv> gam user <username> create contact firstname "'~firstname'" lastname "'~lastname'" email work "'~email'" primary contactgroup "'Group'"

First zsh tries a correction:
zsh: correct 'gam' to '.gam' [nyae]?

When I choose "no", I get the error:
ERROR: Invalid choice (/users/<username>/bin/gamadv-xtd3/gam): Expected <gam>

Is this a bug or did I do something dumb?

Thanks!

Ross Scroggs

unread,
Jun 29, 2021, 1:45:09 PM6/29/21
to google-ap...@googlegroups.com
Add the following line to ~/.zshrc
alias gam="/users/<username>/bin/gamadv-xtd3/gam"

Then do:
source ~/.zshrc

Then do:
gam info domain

Is everything working?

Ross

--
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/6717565e-6fed-403c-b421-f167d689b452n%40googlegroups.com.


--

Jinglan Yao

unread,
Jun 29, 2021, 1:48:57 PM6/29/21
to GAM for Google Workspace
Thanks for the quick reply. 

Sorry, I should have specified that I've added the alias to ~/.zshrc and gam works for everything else. For example, I'm able to add a single contact to a specific user like so:

gam user <username> create contact email work "<email address>" primary contactgroup "Group"

Ross Scroggs

unread,
Jun 29, 2021, 1:58:50 PM6/29/21
to google-ap...@googlegroups.com
It looks like zsh is trying to interpret the second gam which is just a keyword; try:
gam csv <path to file.csv> "gam" user <username> create contact firstname "~firstname" lastname "~lastname" email work "~email" primary contactgroup "Group"

Ross



--

Jinglan Yao

unread,
Jun 29, 2021, 2:49:27 PM6/29/21
to GAM for Google Workspace
Thanks, Ross!

That worked and you pointed me to what I think was the problem. I don't remember why but I had originally set the gam alias as a global alias.

Thanks again!

Reply all
Reply to author
Forward
0 new messages