티스토리 뷰

공부

[jq] jq -r ".values[].name" && cURL cookie

승가비 2022. 11. 3. 15:17
728x90
curl -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -o ./jq
chmod a+x ./jq
./jq -V
export USER=seunggabi
export BITBUCKET_TOKEN=###

brew install jq

mkdir -p ~/workspace
cd ~/workspace

curl -v --cookie "cloud.session.token=$BITBUCKET_TOKEN" https://bitbucket.org/\!api/internal/workspaces/asdf/projects/ASDF/repositories\?page\=1\&pagelen\=100\&sort\=name | 
jq -r ".values[].name" | 
while read name ; do 
  git clone https://$USER@bitbucket.org/asdf/$name.git 
done

https://stackoverflow.com/questions/68121082/how-to-iterate-over-json-array-with-jq

 

How to iterate over JSON array with jq?

I'm building a script to download all CodeCommit repositories at once. REPOS=$(aws codecommit list-repositories) echo $REPOS | jq -r '.[]' | while read name ; do git clone XXX done In first l...

stackoverflow.com

https://www.44bits.io/ko/post/cli_json_processor_jq_basic_syntax

 

커맨드라인 JSON 프로세서 jq : 기초 문법과 작동원리

jq는 커맨드 라인 JSON 프로세서입니다. JSON 데이터를 입력받아 데이터를 필터링하거나 변형합니다. jq의 기본적인 문법과 작동 원리를 소개합니다.

www.44bits.io

https://ohgym.tistory.com/24

 

jq로 JSON 처리하기

api 응답으로 json을 받은 경우 쉽게 데이터를 가공할 수 있는 jq에 대해 정리해본다. 커맨드라인 명령어인 만큼 최소한의 문법만 알아도 유익하게 사용할 수 있다. 설치 $ brew install jq 사용법 아래

ohgym.tistory.com

https://stackoverflow.com/questions/15995919/how-to-use-curl-to-send-cookies

 

How to use cURL to send Cookies?

I read that sending cookies with cURL works, but not for me. I have a REST endpoint like this: class LoginResource(restful.Resource): def get(self): print(session) if 'USER_TOKE...

stackoverflow.com

https://stedolan.github.io/jq/tutorial/

 

Tutorial

Tutorial GitHub has a JSON API, so let's play with that. This URL gets us the last 5 commits from the jq repo. curl 'https://api.github.com/repos/stedolan/jq/commits?per_page=5' Show result [ { "sha": "d25341478381063d1c76e81b3a52e0592a7c997f", "commit": {

stedolan.github.io

https://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_jq_%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C_%EC%84%A4%EC%B9%98

 

리눅스 jq 다운로드 설치 - 제타위키

다음 문자열 포함...

zetawiki.com

https://www.44bits.io/ko/post/cli_json_processor_jq_basic_syntax

 

커맨드라인 JSON 프로세서 jq : 기초 문법과 작동원리

jq는 커맨드 라인 JSON 프로세서입니다. JSON 데이터를 입력받아 데이터를 필터링하거나 변형합니다. jq의 기본적인 문법과 작동 원리를 소개합니다.

www.44bits.io

 

728x90

'공부' 카테고리의 다른 글

[flink] basic  (0) 2022.11.03
[kafka] docker-compose  (0) 2022.11.03
[kotlin] toObject, toJson  (0) 2022.11.02
[bitbucket] default description & checkbox not working in description & team mention not working...  (0) 2022.11.02
[golang] split  (0) 2022.10.19
댓글