Archive for February, 2006

Memoirs of a younger me

Tuesday, February 28th, 2006

As we grow up and create our own universe we get more and more detached from family activities (may be until we start our own, but I’m not there yet!); things we used to do when we were little, which at some point of time was all we’ve got. I’m not sure why … is it that we consider them a lower priority over work or friends (peers as a psychiatrist would put it), or is it that they just “seem” less mature now.

One of those activities my father had always made a Friday ritual: He’d fill the car with kids “me and my brothers” and the trunk with every supply we might need; food, water, jackets .. etc – and he’d hit the road … just drive.

I tell you what, it was fun, then. Well, only then. May be still fun! That’s what last Friday revealed. I really had nothing to do on that day and did not refuse the offer of joining along with the “younger” brothers. No regrets. I’m not able to describe the feeling, is it the rejoice of belonging, spending time with loving parents and energy charged siblings, or maybe being away after a long week of work, or just the green scenary accompanying the road trip. Yes, food was good too: “Armenian sfee7a”!

Enough of the analysis right now, here are some of the most interesting snapshots of that particular Friday .. pretty much self explanatory:

Gotcha – Filenames with spaces and the Shell

Thursday, February 23rd, 2006

I had to write to a shell script that parses a bunch of files. The
problem was some of the file names contained spaces. Here is a sample
scenario and the resolution.

Let’s say you had files: “test 1″ and “test 2″ and you tried to do
something as trivial as:

#!/bin/bash

for f in `ls test*`
do

cat $f

done

the result would be:

cat: test: No such file or directory
cat: 1: No such file or directory
cat: test: No such file or directory
cat: 2: No such file or directory

The resolution would be:

#!/bin/bash

IFS=”

for f in `ls test*`
do

cat $f

done

The explanations is that the IFS (interfield seperator) in the shell
defaults to space tab or newline. The space is part of the filename in
our case which will result in two seperate files.
So what we do at the begining of the script is set the IFS variable to
newline only.

Infected; Snow Crash has gotten to me!

Wednesday, February 22nd, 2006

Silly, useless, pretty much nonsense … were the words I described blogging with. Yet here I am jotting down my first blog entry.

It is truly amazing how the Internet is evolving into a lively world in a parallel dimension where humans metphorically breathe, feed, and (well in some increasing number of cases) reproduce.

It’s Web 2.0. I’m upgrading! The time has come when packets reincarnate to words that humans rather than routers process. Web pages are now blogs, podcasts, and photo albums. Ideas of all sort are being broadcast, into a virtual medium reflecting and affecting ‘real’ life.

Been watching it, now part of it.