Magic Incantation Du Jour!
Jul. 22nd, 2008 08:19 pmHave you signed up for Tor.com's "Free ebook of the week?" Do you own a Palm Pilot? Do you Pluck? If so, then this incantation is for you!
ls *.html | perl -ne 'chomp; $p = $_; $t = $p; $t =~ s/.html//; $f = $t; $f =~s/\W//g; print qq{plucker-build --stayonhost -f $f.pdb -N "$t" -P . "$p"\n}' | bash
ls *.html | perl -ne 'chomp; $p = $_; $t = $p; $t =~ s/.html//; $f = $t; $f =~s/\W//g; print qq{plucker-build --stayonhost -f $f.pdb -N "$t" -P . "$p"\n}' | bash
Where do we sign up?
Date: 2008-07-23 05:32 am (UTC)I found this most awesome page, though:
http://tor.com/index.php?option=com_content&view=blog&id=577
I already owned a couple of those books, and I'm looking forward to reading the others.
. png
Re: Where do we sign up?
Date: 2008-07-23 05:55 am (UTC)Re: Where do we sign up?
Date: 2008-07-23 06:30 am (UTC). png
no subject
Date: 2008-07-23 05:38 am (UTC)no subject
Date: 2008-07-23 05:50 am (UTC)no subject
Date: 2008-07-23 10:47 am (UTC)* "ls *.html | ..." is generally better done with "find . -name '*.html' -print0 | ... -0 ..."; that way the shell doesn't choke if there are lots of .html files in the directory, and downstream code doesn't choke on weird characters in the name.
* Piping to shells is scary; "system" (with the full path to the command, and the arguments in a list) is generally considered safer. I realize that you're probably not reading "The Story of Little Bobby Tables", but as written you'll get burned by (at a minimum) ", $, and \ characters in the filenames.
no subject
Date: 2008-07-23 08:21 pm (UTC)Yeah, this string is special-purpose: I don't intend to run it just anywhere. My assumption was that it would be used for the Tor ebook collection, which so far has the very regular format of Lastname, Firstname - Title of Book.html, and unless someone's doing something very weird I'm not likely to get Bobbytabled.
no subject
Date: 2008-07-23 08:41 pm (UTC)