Skip to content

Instantly share code, notes, and snippets.

@jnbdz
Last active June 18, 2023 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jnbdz/11ec3a1b6a2665aa266d7d751920a1a9 to your computer and use it in GitHub Desktop.
Save jnbdz/11ec3a1b6a2665aa266d7d751920a1a9 to your computer and use it in GitHub Desktop.
#!/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