2016-08-10 3 views
1

신속한 CLI를 사용하고 있으며 컨테이너에서 여러 개체를 다운로드하려고합니다.신속한 목록 -p 변수가 설정되지 않음

나는 그런

for i in `swift list container -p object/201505`; do swift download container $i; done 

문제가 내가 검색하고 모든 일치를 다운로드해야 할 여러 개체가 같이이 작업을 수행 할 수 있습니다. 나는 작은 스크립트에서 그것을 시도했다.

#!/bin/bash 

while read objects; 
SAMPLE=$(swift list container objects); 
do 
for i in $SAMPLE; do `swift download container $i`; done 
done < samples_list 

하지만 저는 항상 다음과 같이 인사합니다.

Usage: swift [options] list [options] [container] 
    Lists the containers for the account or the objects for a container. -p or 
    --prefix is an option that will only list items beginning with that prefix. 
    -d or --delimiter is option (for container listings only) that will roll up 
    items with the given delimiter (see Cloud Files general documentation for 
    what this means). 

내 변수가 읽히지 않았습니까? 설정 한대로 올바른 접두사가있는 파일 만 다운로드하려면 어떻게합니까?

답변

1

정말 swift 몰라,하지만 난 당신이 내가 swift list는 출력에 한 줄에 하나의 항목을 기록합니다 가정입니다

#!/bin/bash 

while read objects; do 
    swift list container "$objects" | while read i; do 
    swift download container "$i" 
    done 
done < samples_list 

을 원하는 생각합니다.

+0

친애하는 각하, 빠른 응답을 가져 주셔서 감사합니다. 변경 내용을 반영하도록 스크립트를 편집했으며 동일한 오류가 발생합니다. 필자는 불필요한 일을 처리하고 신속한 문제를 더 많이 조사 할 것입니다. –

관련 문제