0
curl -s http://meet97263421.adobeconnect.com/api/xml?action=common-info | \
grep -oP '(?<=<cookie>).*?(?=</cookie>)|(?<=account-id=").*?(?=")' 2>&1\

上記の curl/grep コマンドは、次のデータを返します。

na3breezswp8yf3s5fghdgn4
1013353222

これら 2 つの出力を 2 番目の curl コマンドに送信するにはどうすればよいですか。

curl "https://meet97263421.adobeconnect.com/api/xml?\
action=login&login=USERNAME&password=PASSWORD&account-id=[$1]&session=[$0]"

[$1][$0]をプレースホルダーとして使用しています。

4

1 に答える 1

1

たぶん、このヘルプ:

#!/bin/bash

OUT=$(curl -s http://meet97263421.adobeconnect.com/api/xml?action=common-info \
| grep -oP '(?<=<cookie>).*?(?=</cookie>)|(?<=account-id=").*?(?=")')

# echo $OUT && echo 

Session=$(cut -f1 -d' ' <<< $OUT)
AccountID=$(cut -f2 -d' ' <<< $OUT)

curl "https://meet97263421.adobeconnect.com/api/xml?action=login&login=USERNAME&password=PASSWORD&account-id=$AccountID&session=$Session"

# or 

curl "https://meet97263421.adobeconnect.com/api/xml?action=login&login=USERNAME&password=PASSWORD&account-id=`cut -f2 -d' ' <<< $OUT`&session=`cut -f1 -d' ' <<< $OUT`"
于 2012-11-12T02:51:14.503 に答える