[plug] Self encrypting drives
Brad Campbell
brad at fnarfbargle.com
Thu Feb 2 09:05:49 AWST 2017
On 01/02/17 22:26, David Godfrey wrote:
> Hi Brad,
>
>
> Sorry for the two errors, that's what comes of writing code without the
> required infrastructure to test it against :-)
> Having said that, I know the regex can't be inside single quotes, that
> was simply a slip of the fingers.
>
> The logic error on the other hand is unforgivable, it's damn obvious,
> and I would have caught it if I had done some tests, but was too lazy to
> whip up a test wrapper ;-)
>
> Glad to be able to throw some useful tips out there, I personally try to
> stick to pure bash where I can, piping stuff out to sed, grep, awk, cut,
> tr, etc only when speed is an issue (which isn't so common a problem),
> or when the quantity of code required to do it in bash gets excessive.
> The main reason for that is long term maintainability, doing it in bash
> is normally much easier to understand in 12 months time than some arcane
> sed, grep, awk invocation.
> I've seen regex's that use back references and other tricks that can
> take hours to unravel, and even longer to debug when you com back to
> them 12 months later.
> When they were written you go "Thats awesome, I've done something nearly
> impossible there" but in 12 months you curse yourself 6 ways from Sunday.
I've reached that point where my memory isn't as good as it used to be
(42 & 2 kids under 3), so a couple of years ago I started leaving little
text files all over the place with notes in them. My code is worse, but
my documentation is better, so when I go back to something 2 years after
the fact I can refer to the text file for the explanation as to what and
why I did what I did. I've become particularly good at documenting any
regex because now I tend to forget how it works a matter of days after I
wrote it.
As for bash, I'm still learning about all the stuff it has built-in and
I've been using it in anger since 1996. I still tend to lean on sed,
grep & awk because that's how I started out and I've never really had
the time to figure out a better way to skin the cat. A bit like I have
thousands of lines of AutoLISP, and as it still works I've never
bothered to learn about AutoCADs VBA or COM scripting interfaces.
Regards,
Brad
More information about the plug
mailing list