I did a hyper-wrong thing
Mar. 8th, 2007 09:17 amWell, I finally did it: one of those "hyper-wrong" things that's so easy to do with Linux. I'm pretty sure I haven't previously done it this century. I think I might never have done it before in precisely this way, but merely heard of others who have done it.
I happen to have excellent proprioception in the fingers of my forepaws (which is quite unusual for a dog, but things are what they are), so I knew instantly that I'd just done a damn fool thing. The milliseconds ticked by as my phalanges moved in bullet-time to the Ctrl/C position. But Linux 2.6, along with the ext3 filesystem and my laptop hard drive, were able to complete the command before I could press the abort key. Linux is *much* faster than Windows at deleting 1150 files that I didn't really want to throw away! Also, ext3 is much worse than FAT32 at being able to recover files that were erroneously deleted. So I declared the workday to be over and goofed off for awhile.
Although I had been working on those files for 2½ hours, I hadn't really lost much. It was a set of DOC files in subdirectories. I had deleted some files that were duplicated in multiple dirs, and also renamed some that had the same names in different dirs but were not actually duplicates. I'd kept lists of both of these, so the changes could be made again. Most of the time was spent debugging this script, for dealing with the fact that 161 of the 990 files claimed to be DOC but were actually RTF (which is another Microsoft Word document format, not compatible with the wv library I intended to use to process the DOCs). It turns out that the OpenOffice API function StarDesktop.loadComponentFromURL() silently fails if its first argument is a relative pathname instead of absolute. But I know that now, so I could probably rerun the conversions in only a few minutes. I'm still not sure why I left out the last four characters in the "rm */*.rtf" command, which seemed wrong as soon as I did it.
Changing RTF to DOC wasn't supposed to be my job. My boss, "Mr. Bear" at Company 𝔾, was supposed to do it, manually loading each file into Microsoft Word and then saving in the proper format. But I thought I'd show off The Power of Linux by writing a command-line batch converter. Perhaps I should have told him that I was working on this, but it seemed easy enough to just do it and send him the results.
Less than five minutes after the disaster, an email arrived from Mr. Bear: he had finished the manual conversion of RTF to DOC! It surely took him at least an hour of repetitive labor, so now he probably doesn't want to hear that I could have done it for him. Oh well. This issue will probably come up again, and now I know how to automate it.
Hey, is anyone else reminded of DEC Wars, a silly Star Wars fanfic from 25 years ago? (Warning: not especially furry.) The Empire's ultimate weapon is the "Are-Em Star" -- hardy har har!
rm */*
Now "rm * .o" is merely an extra-space typo, while "rm *" is just wrong, but "rm */*" is hyper-wrong, though not as wrong as the "rm -r /*" equivalent that I once did. Still, at least a 3 on the Richter scale of wrongness.I happen to have excellent proprioception in the fingers of my forepaws (which is quite unusual for a dog, but things are what they are), so I knew instantly that I'd just done a damn fool thing. The milliseconds ticked by as my phalanges moved in bullet-time to the Ctrl/C position. But Linux 2.6, along with the ext3 filesystem and my laptop hard drive, were able to complete the command before I could press the abort key. Linux is *much* faster than Windows at deleting 1150 files that I didn't really want to throw away! Also, ext3 is much worse than FAT32 at being able to recover files that were erroneously deleted. So I declared the workday to be over and goofed off for awhile.
Although I had been working on those files for 2½ hours, I hadn't really lost much. It was a set of DOC files in subdirectories. I had deleted some files that were duplicated in multiple dirs, and also renamed some that had the same names in different dirs but were not actually duplicates. I'd kept lists of both of these, so the changes could be made again. Most of the time was spent debugging this script, for dealing with the fact that 161 of the 990 files claimed to be DOC but were actually RTF (which is another Microsoft Word document format, not compatible with the wv library I intended to use to process the DOCs). It turns out that the OpenOffice API function StarDesktop.loadComponentFromURL() silently fails if its first argument is a relative pathname instead of absolute. But I know that now, so I could probably rerun the conversions in only a few minutes. I'm still not sure why I left out the last four characters in the "rm */*.rtf" command, which seemed wrong as soon as I did it.
Changing RTF to DOC wasn't supposed to be my job. My boss, "Mr. Bear" at Company 𝔾, was supposed to do it, manually loading each file into Microsoft Word and then saving in the proper format. But I thought I'd show off The Power of Linux by writing a command-line batch converter. Perhaps I should have told him that I was working on this, but it seemed easy enough to just do it and send him the results.
Less than five minutes after the disaster, an email arrived from Mr. Bear: he had finished the manual conversion of RTF to DOC! It surely took him at least an hour of repetitive labor, so now he probably doesn't want to hear that I could have done it for him. Oh well. This issue will probably come up again, and now I know how to automate it.
Hey, is anyone else reminded of DEC Wars, a silly Star Wars fanfic from 25 years ago? (Warning: not especially furry.) The Empire's ultimate weapon is the "Are-Em Star" -- hardy har har!