I'm a big user of https://www.grc.com/passwords.htm to get strong passwords. However, having to go to the site and manually copy the password every time gets old fast, so I decided to do a little script to do it for me. Every time you reload the page, it presents you with new passwords in plain text, so this is the script.
curl 'https://www.grc.com/passwords.htm' | grep '63 random printable ASCII characters:' | sed 's/^.*size=2>//' | sed 's/<\/font>.*$//' | pbcopy
Since there's no identifying classes or IDs, I get the page through
curl, pipe it to
grep to get the line I want ("63 random printable ASCII characters:"), and then I use
sed to delete everything up to the password, as well as everything after it, finally copying to the clipboard with
This all works fine, except for one small detail. The string I get in the end should always be 63 characters long, but it's not. It usually varies between 64, 67, 70 and 73 and I have no idea why.
Can anyone shed any light on this?