TODRIVE writes the command into the file description, but without quotes

108 views
Skip to first unread message

Harold Horsman

unread,
Jun 26, 2019, 5:13:06 AM6/26/19
to GAM for G Suite
Hi all, Hi Ross,

There is a great feature in the TODRIVE parameter. When you create a file with it, it also writes the command that produced the file into the description of the file. I find this very useful.
But there is an issue with it when I am using spaces into the file name that follows TODRIVE.

As an example: 
I use the following command to generate a list of ACL's for Teamdrives. This raw data file is then referenced by another sheet that shows statistics and nice overviews.
~/bin/gamadv-xtd3/gam print teamdriveacls oneitemperrow todrive tdtitle "Team Drives Access Control Lists - Generated RAW DATA" tdfileid 1234567890.......  tdsheet AccessControlList tdtimestamp true tdnobrowser true



When I look at the description of the file that is created, it doesn't contain the quotes anymore. That leads to problems when I, or anyone else in my group, wants to recreate the file, using the command in the description.

~/bin/gamadv-xtd3/gam print teamdriveacls oneitemperrow todrive tdtitle Team Drives Access Control Lists - Generated RAW DATA tdfileid 1234567890.......  tdsheet AccessControlList tdtimestamp true tdnobrowser true


Am I doing something wrong here? Is it a bug? Is there a solution for this?

Jay Lee

unread,
Jun 26, 2019, 5:24:50 AM6/26/19
to google-ap...@googlegroups.com
Yep, almost certainly a bug. The challenge here is you OS shell is actually the one to split up the command arguments and pass them on to Python/GAM so GAM never has a chance to see the raw command you ran but at the very least we can re-quote any arguments that contain spaces.

Mind creating an issue on GitHub for this?

Jay

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/bc85bd00-fac5-4481-a7e9-89197fa90fba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ross Scroggs

unread,
Jun 26, 2019, 8:42:34 AM6/26/19
to google-ap...@googlegroups.com
Harold,

Show an example of the process of recreating the file from the description.

Harold Horsman

unread,
Jun 26, 2019, 9:11:43 AM6/26/19
to GAM for G Suite
Ross,
The example is already in my post. The first piece of code was the original command, the second was how it was stored into the file description. (I edited the fileid for security reasons).
The difference is in the quotes(") that are missing.

The desired process of recreating the result file is by copying the code from the description of the file and then executing it on the commandline.
Note that I have multiple of such files, containing raw data coming from GAMADV commands. This way, the origin of the data is documented and can be used to reproduce the result.


On Wednesday, 26 June 2019 14:42:34 UTC+2, Ross Scroggs wrote:
Harold,

Show an example of the process of recreating the file from the description.

On Jun 26, 2019, at 2:13 AM, Harold Horsman <harold...@vra.nl> wrote:

Hi all, Hi Ross,

There is a great feature in the TODRIVE parameter. When you create a file with it, it also writes the command that produced the file into the description of the file. I find this very useful.
But there is an issue with it when I am using spaces into the file name that follows TODRIVE.

As an example: 
I use the following command to generate a list of ACL's for Teamdrives. This raw data file is then referenced by another sheet that shows statistics and nice overviews.
~/bin/gamadv-xtd3/gam print teamdriveacls oneitemperrow todrive tdtitle "Team Drives Access Control Lists - Generated RAW DATA" tdfileid 1234567890.......  tdsheet AccessControlList tdtimestamp true tdnobrowser true



When I look at the description of the file that is created, it doesn't contain the quotes anymore. That leads to problems when I, or anyone else in my group, wants to recreate the file, using the command in the description.

~/bin/gamadv-xtd3/gam print teamdriveacls oneitemperrow todrive tdtitle Team Drives Access Control Lists - Generated RAW DATA tdfileid 1234567890.......  tdsheet AccessControlList tdtimestamp true tdnobrowser true


Am I doing something wrong here? Is it a bug? Is there a solution for this?


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Harold Horsman

unread,
Jun 26, 2019, 9:14:13 AM6/26/19
to GAM for G Suite
Hi Jay,

I can certainly try. Should it be posted to the GAMADV-XTD3 issue list, or to the general GAM issues?


On Wednesday, 26 June 2019 11:24:50 UTC+2, Jay Lee wrote:
Yep, almost certainly a bug. The challenge here is you OS shell is actually the one to split up the command arguments and pass them on to Python/GAM so GAM never has a chance to see the raw command you ran but at the very least we can re-quote any arguments that contain spaces.

Mind creating an issue on GitHub for this?

Jay

On Wed, Jun 26, 2019, 5:13 AM Harold Horsman <harold...@vra.nl> wrote:
Hi all, Hi Ross,

There is a great feature in the TODRIVE parameter. When you create a file with it, it also writes the command that produced the file into the description of the file. I find this very useful.
But there is an issue with it when I am using spaces into the file name that follows TODRIVE.

As an example: 
I use the following command to generate a list of ACL's for Teamdrives. This raw data file is then referenced by another sheet that shows statistics and nice overviews.
~/bin/gamadv-xtd3/gam print teamdriveacls oneitemperrow todrive tdtitle "Team Drives Access Control Lists - Generated RAW DATA" tdfileid 1234567890.......  tdsheet AccessControlList tdtimestamp true tdnobrowser true



When I look at the description of the file that is created, it doesn't contain the quotes anymore. That leads to problems when I, or anyone else in my group, wants to recreate the file, using the command in the description.

~/bin/gamadv-xtd3/gam print teamdriveacls oneitemperrow todrive tdtitle Team Drives Access Control Lists - Generated RAW DATA tdfileid 1234567890.......  tdsheet AccessControlList tdtimestamp true tdnobrowser true


Am I doing something wrong here? Is it a bug? Is there a solution for this?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Ross Scroggs

unread,
Jun 26, 2019, 9:14:25 AM6/26/19
to google-ap...@googlegroups.com
Harold,

Thanks, I had just understood what you were talking about when your reply cam in. I'll fix this morning.

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Harold Horsman

unread,
Jun 26, 2019, 9:19:38 AM6/26/19
to GAM for G Suite
Thank you, Ross. 
Your fixing speed is competing with the speed of light, did you know? :-)


On Wednesday, 26 June 2019 15:14:25 UTC+2, Ross Scroggs wrote:
Harold,

Thanks, I had just understood what you were talking about when your reply cam in. I'll fix this morning.

Ross Scroggs

unread,
Jun 26, 2019, 10:20:24 AM6/26/19
to google-ap...@googlegroups.com
Harold,

Try 4.88.01

Ross

Thank you, Ross. 
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--

Harold Horsman

unread,
Jun 26, 2019, 10:35:50 AM6/26/19
to GAM for G Suite
Ross,

Tested this on 2 different files; one file with 1 and one file with 2 space-delimited description. Both were given a file description with quotes now. Works like a charm.
Thank you for your amazing support!
Harold,

Try 4.88.01

Ross

Thank you, Ross. 
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.


--
Ross Scroggs

Scott Marquardt

unread,
Jan 6, 2022, 2:41:33 PM1/6/22
to GAM for Google Workspace
How does one suppress this behavior for writing to the description?

And would it be possible to force a different string to the description upon successful execution? 

Possible feature: append or prepend new string to existing description. 

Scott Marquardt

unread,
Jan 6, 2022, 2:43:15 PM1/6/22
to GAM for Google Workspace
Whoops, my bad.  tddescription. 
Reply all
Reply to author
Forward
0 new messages