And if you don't have lynx and xclip, you can use the standard GNU Unix toolset.
After a tiny bit of trial and error - This one-liner worked in cygwin - to extract the links from the bookmarks.html I exported from Firefox on my Windows PC at work.
Code:
\grep HREF= ~/bookmarks.html | awk '{print $2}' > ~/bookmarks.txt; sed -i -- '/place:/d; s/HREF=//g; s/"//g' ~/bookmarks.txt
Assuming that the Linux version exports the bookmarks in the same format, the above one-liner should work in Linux too.
The grep command searches for lines in ~/bookmarks.html that contain the string "HREF=".
Matching lines are piped to awk, where we print the 2nd field, which should contain the HREF= property containing a website URL. Awk outputs that to a new file called ~/bookmarks.txt.
Then we use sed on ~/bookmarks.txt to filter out the HREF= tags and the double quotes that enclose the URLs/links for our bookmarks.
We're also ignoring lines that contain "place:".
URLS with "place:" in them are used internally by firefox and contain metadata about any folders/subfolders you have in firefox's bookmark manager. So we want to exclude those URLS from our final output too.
The -i option to sed means that sed will edit the input file in place. So any changes are made directly to ~/bookmarks.txt.
So in the end, we should just end up with a text file with a bunch of website URLs.
Job done! Hopefully?!
And before anybody says anything - yes, I do have to use Windows at work - but I don't get any choice about that. But I try to use as much free-software as possible. Sometimes Cygwin is the only thing that keeps me sane!
But at home, I'm 100% Linux and free-software! XD