Just another [stupid] BASH one-liner

Just another stupid yet handy one-liner I came up with while doing nothing useful.

I was sitting in front of a shell, wondering why some files in some directory existed with three different extensions while others didn’t, when it hit me that all files should exist with three different extensions for something altogether different to work. Instead of manually touch‘ing all those files that didn’t exist with all three different extensions, I farted the following BASH one-liner.

for i in *.frm; do base=$(echo $i | sed s/.frm$//); if [ ! -f $base.MYD ] && [ ! -f $base.MYI ]; then touch $base.MY{D,I}; fi; done

;-) The fact that my initial speculation that doing so would get something altogether different to work failed miserably is irrelevant.

Note: Sudden absence

I have not been able to get online much the past week. Both my phone lines are dead, and I have no hope to expect they would be fixed any time soon. I don’t get time to get online from work either, so I am cut-off from the Internet to a great extent. This post serves as a brief reminder to those who have been expecting me online the past week and surprised to not find me online anywhere.

Usually, when I cannot get online because of a dead phone line or some other reason, I am mighty pissed. It is odd that, despite being away from the Internet the past week, I didn’t feel annoyed at all. Not that I did a lot of productive things last weekend, and even though I did get bored, I somehow kept my composure. My brother, funnily enough, got extremely pissed instead. :-)

See you in a while.

The earlier you fall, the better! (Random Musings #25)

Random login quote, as I logged into my Linux box early in the morning at work:

…most of us learned about love the hard way. Even warnings are probably useless, for somehow, despite the severest warnings of parents and friends, hundreds, thousands of women have forgotten themselves at the last minute and succumbed to the lies, promises, flatteries, or mere attentions of lusting, lovely men, landing themselves in complicated predicaments from which some of them never recovered during their entire lives. And I am not speaking only of your teenaged Midwesterners in 1958; I’m speaking of women of every age in every city in every year. The notorious sexual revolution has saved no one from the pain and confusion of love.— Alix Kates Shulman