I needed to pull every public repo in a user's GitHub account. To do this I got the API output of https://api.github.com/users/SOMEUSER/repos This is what I came up with. To extract the ssh_url line from the file I:sed -n '/ssh_url/p' SOMEFILENow I am left with the ssh url to the repo but there are quotes around it. Now I came up with:awk -F\ '{print $(NF-1)}' Then I put it all together:curl https://api.github.com/users/SOMEUSER/repos | sed -n '/ssh_url/p' | awk -F\ '{print $(NF-1)}' | xargs -n1 git cloneNow I got it to work, that's good and great. Why does it work?
understanding sed, awk and curl interaction extracting ssh URL information from github page
bash;awk;xargs