Created
December 1, 2019 13:09
-
-
Save circleous/4d67b6289ffaa63ea7df7bee4db53296 to your computer and use it in GitHub Desktop.
KOM311 Sistem Operasi - Week 14 - misc command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ $# -ne 1 ]; then | |
| echo -e "$0 - get last gists from a user" | |
| echo -e "Usage:" | |
| echo -e "\t$0 <username>\n" | |
| echo -e "Example:" | |
| echo -e "\t$0 circleous" | |
| else | |
| url=`curl -s https://api.github.com/users/$1/gists | grep url | head -n 1 | awk '{print $2}' | sed 's/"\(.*\)",/\1/'` | |
| echo -e "$(curl -s $url | jq -rM .files[].content)" | |
| unset url | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment