Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Audit Export Download Script issues. Using variable that contains name and code.

46 views
Skip to first unread message

Phillip

unread,
May 16, 2012, 12:29:31 PM5/16/12
to google-ap...@googlegroups.com
I'm trying to make a batch export of users inboxes, but every time I run the command, GAM responds with the help window saying that I'm using the wrong option. I've posted the script below.

Script:
MY_FILE=./TestCodeList.csv
OIFS
=$IFS;
IFS
=$'\n';
for line in $( < "$MY_FILE" ); do
        echo
"~/gam/gam.py audit export download $line | tee -a DownloadExport.log;";

       
~/gam/gam.py audit export download ${line} | tee -a DownloadExport.log;
done
IFS
=$OIFS

TestCodeList.csv:
MelvinBaker 62064297
kate
62072021




Message has been deleted

Phillip

unread,
May 16, 2012, 12:36:44 PM5/16/12
to google-ap...@googlegroups.com
I forgot to mention the following:

Operating System: OS X Lion, 10.7.4
Script language: BASH
GAM Version: 2.3.1

Phillip

unread,
May 16, 2012, 1:28:41 PM5/16/12
to google-ap...@googlegroups.com
I have gotten around this issue by using the following script:
MY_FILE=./TestCodeList.csv
OIFS=$IFS;
IFS=$'\n';
for line in $( < "$MY_FILE" ); do
        name=$(echo $line | awk -F" " '{print $1}');
        code=$(echo $line | awk -F" " '{print $2}');
        echo "~/gam/gam.py audit export download $name $code | tee -a DownloadExport.log"
        ~/gam/gam.py audit export download $name $code | tee -a DownloadExport.log
done
IFS=$OIFS

Reply all
Reply to author
Forward
0 new messages