Hi all,
I'm building a shell script and trying to include some logic to create a folder in the root of a users drive, but only if one of that exact name doesn't exist already.
Creating the folder works fine:
gam user itadmin create drivefile drivefilename "GAM-Logs" mimetype gfolder
But will keep making identically named folders unless I check first. What's the best way to test?
I can get the output of something like
gamma-base-1% gam user itadmin show fileinfo drivefilename "ejfnweofhweofhweoufh"
Getting all Drive Files/Folders that match query ('me' in owners and name = 'ejfnweofhweofhweoufh') for
ita...@domain.comGot 0 Drive Files/Folders that matched query ('me' in owners and name = 'ejfnweofhweofhweoufh') for ita...@domain.com...
User:
ita...@domain.com, Show 0 Drive Files/Folders
and grep through it to use in an if/then... for a result like "Got 1 Drive Files/Folders..." or "Got 1 Drive Files/Folders...", but am wondering if there's a more elegant way?
Thanks!