Forked from GeoffreyPlitt/convert_url_files_to_bookmarks.sh
Last active
July 21, 2024 16:06
-
-
Save Craterdome/50028e20a5d06178e6822405076a8711 to your computer and use it in GitHub Desktop.
Convert a text file of urls (urls.txt) to a bookmarks.html file that can be imported into a browser
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
#!/bin/bash | |
# | |
# Run this script on a file named urls.txt with all your URLs and pipe the output to an HTML file. | |
# Example: ./convert_url_file.sh > bookmarks.html | |
# Based on changes from Jan van den Berg: https://j11g.com/2019/08/15/create-a-chrome-bookmark-html-file-to-import-list-of-urls/ | |
echo "<!DOCTYPE NETSCAPE-Bookmark-file-1>" | |
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">' | |
echo '<TITLE>Bookmarks</TITLE>' | |
echo '<H1>Bookmarks</H1>' | |
echo '<DL><p>' | |
cat urls.txt | | |
while read L; do | |
echo -n ' <DT><A HREF="'; | |
echo ''"$L"'">'"$L"'</A>'; | |
done | |
echo "</DL><p>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment