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' SOMEFILE

```

Now 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 clone

```

Now I got it to work, that's good and great. Why does it work?