我学会了如何下载单个谷歌文档。但我正在尝试制作一个脚本,以文本格式下载我的所有数据,然后将它们合并到 1 个文本文件中。所以,我想知道如何实现下载部分,以便 1 可以像使用网络浏览器一样获取包含我所有文件的 zip 文件。这是我获取单个文件的 newb 脚本。希望您能提出一些调整,使其更有效。
#!/bin/bash
token=$(curl -s https://www.google.com/accounts/ClientLogin -d Email=user.name@gmail.com -d Passwd=blahblah -d accountType=GOOGLE -d service=writely -d Gdata-version=3.0 |cut -d "=" -f 2)
set $token
wget --header "Gdata-Version: 3.0" --header "Authorization: GoogleLogin auth=$3" "https://docs.google.com/feeds/download/documents/Export?docID=${resourceId}&exportFormat=txt" -O /tmp/${file[$i]}.txt
如您所见,在这里我指定了单个resourceId 。我应该只是在下载链接中推送许多resourceId -s 以获取它们还是有更好的方法?