Last active
June 18, 2023 10:23
-
-
Save jnbdz/11ec3a1b6a2665aa266d7d751920a1a9 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
googlechromebookmarks() { | |
cat ~/.config/google-chrome/Default/Bookmarks | \ | |
grep -E '\"name|\"url' | \ | |
grep -vE '\"type\"\:' | \ | |
awk '{print $1 substr($0,index($0,$2))}' | \ | |
sed s'/^\"name\"\:/title \= /' | \ | |
sed s'/^\"url\"\:/url \= /' | \ | |
sed s'/\,$//' | \ | |
awk 'BEGIN { | |
title=""; | |
re="" | |
} | |
{ | |
if ( $1 ~ /^url/) { | |
re=re""title" "$0"\n\n"; | |
} else if ( $1 ~ /^title/ ) { | |
title=$0"\n"; | |
} | |
} | |
END { | |
print re; | |
}' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment