0

我正在尝试编写代码以从 Google 的 GAM 脚本中提取返回值。

我编写了一个程序来查看如何返回值并希望与它们进行交互,但我运气不佳。下面是测试代码的样子:

#!/bin/bash
    gam_test(){
             OAUTHFILE=oauth.txt
            local gtestout=`~/gam/gam.py info user "$email" > test`
    }
    fname="April"
    lname="O'Neil"
    letter1=${fname:0:1}
    letter2=${lname:0:1}
    error_out="Error: 1301 - Entity AOkccp30@ga4edu.org Does Not Exist"
    concatemail=$letter1$letter2"kccp30@ga4edu.org"
    fullemail="AOkccp30@ga4edu.org"
    email=$fullemail
    gam_test
    sleep 5
    echo "---------"
    sleep 3
    echo $gtestout
    echo "---------"
    if [ "$error_out" -eq `gam_test` ]
            then
                    echo "Test 1 Success!! They are the same when you feed it emails!"
            else
                    echo "TEST 1 FAIL! WHAT DID YOU DO!?"
                    echo $error_out"/...test..../"
                    echo $gam_test"/....gam_test.../"
            fi
    email=$concatemail
    gtestout=$(python ~/gam/gam.py info user "$email" &)
    echo "---------"
    sleep 3
    echo $gtestout
    echo "---------"
    if [ "$error_out" == "$gtestout" ]
            then
                    echo "Test 2 Success!! They are the same when the program generates emails!"
            else
                    echo "TEST 2 FAIL! WHAT DID YOU DO!?"

我尝试了其他一些方法,但我似乎无法弄清楚。

4

0 回答 0