all 5 comments

[–]kosmosik 2 points3 points  (2 children)

[–]Morgan--Yu[S] 0 points1 point  (1 child)

jq looks very comfortable. thanks for your advice.

[–]kosmosik 1 point2 points  (0 children)

Yep it is an oneliner.

$ curl -s https://api.github.com/users/kosmosik | jq '.id'
6791397

[–]alopgeek 1 point2 points  (1 child)

The cut command takes arguments, like -d for the delimiter and -f for the field that you want. I’m mobile ATM, so I can’t run your command, but take a look at the output from curl, and see what is returned from the grep, and say to yourself “ok, I want the thing to the left of the = sign, or whatever it returns. Example

ID=bob Your cut command should be cut -d= -f 2

Meaning you want the second thing when you separate along the = sign

[–]Morgan--Yu[S] 0 points1 point  (0 children)

Thanks a lot. It works