Log in

No account? Create an account

In search of kin

Tonight I learned about the big brother of the history substitution operator in bash.I have known for a very long time that if your last command was something like:

du -sh /usr/local/src/foo
You could repeat the command with a slightly different set of arguments by doing
Which would execute
du -sh /usr/local/src/bar
This has a caveat - it will only replace the first instance of foo with bar (why? Who knows..)

If instead, you do:

It will replace all instances of foo with bar in all your arguments.

You might wonder what I'm doing where this is useful. A few years back I wrote a simple perl script that compares lists of files to let me know if two places are the same or not (maybe I've reinvented some subset of rsync, but I don't like rsync and I like having control over formatting and stuff. Tonight I've been working on reconciling home directories for a server that coexisted with its predecessor, allowing (sigh) people to log on to both for a month or so. Just for starters, to find out what home directories I need to think about, I do on the new server:

cd /home
~pgunn/bin/fldiff `find username/ -type f -exec ls -l \{} \;` VS `ssh root@oldserver "cd /home && find username/ -type f -exec ls -l \{} \;"`

I don't want to type each username twice, nor do I want to manually page around inside that commandline each go. I do similar things with tools I've written that rename large groups of files with regexes.

This is above the normal threshold where I think people should consider not using shell, instead moving to perl (or whatever scripting language suits their fancy), but it's a little too variable for me to really want to do that.

I may have badly mismanaged time at work, and I'm a bit worried about it. I thought a certain task was significantly smaller than it was, and only noticed when I was deploying it that there's a lot of other tricky stuff I was supposed to do too - If I had known this I would have said "no" or delayed a lot of other things that needed doing. Sigh. My productivity is a lot lower than it should be for various reasons anyhow. I might need to do a lot of marathon software design/programming to avoid people getting upset.

I sometimes wonder what my life would've been like if I had been successful at flirting with some of the people I tried to flirt with in the years since my last gf. In particular, presuming there had been interest going the other way and availability, and I had dated some of the people I had wanted to, I wonder which, if any, of them might've been good candidates for a relationship. I've known people who have systemic flaws in their dating circles - people who are either fanatic about a set of features smaller than those they need to be happy, people who have inconsistencies (or a desire for rare permutations that have elements that go against each other), or people who are driven by instinct to want things that are harmful for them. It's hard to see these things in oneself (perhaps creative intelligence meets the bill for type one for me)..

Incomplete rambling about technocrat-ism snipped.
(section not shown)



that is just different enough from the standard syntax i'm used to (:s/foo/bar/g) that it's worrying..