The Diary of a Linux NERD!
The following is what a nerd with a capital N writes in his diary about a particular shell scripting problem. To appreciate the situation, first understand the technicalities of the issue. When you invoke a piped “while” in bash, it creates a new sub-shell to run the program and thus what ever variables that you use inside the while, has only local scope. Hence when you get out, the modifications are lost. For a clearer picture of the actual technical issue please read
http://www.kilala.nl/Sysadmin/script-variablescope.php
(Please do not proceed without understanding the actual issue since I stand a chance of being grossly misinterpreted otherwise)
Dear Diary,
Today she (bash) behaved very badly with me. Like I have been telling you lately, She has been acting very strange. It’s like she’s a totally different person. Every day she comes up with more and more mood swings (modes via command switches) particularly while dealing with others that work with her (programs). Gone are the days when she knew what I wanted and I knew how to get it from her. The more I have gotten to know her, the lesser I have understood about her vagaries.I know I can’t interface with her as well as they (programs) do and I accept that but all I ask for is a little bit of consideration for my feelings. Is that too much to ask? But she’s not at all bothered of my feelings, telling that I am jealous and paranoid since it’s not her mood but her colleague’s (programs) with whom she has to deal with (run). But I feel its cuz shes behaving so freely with them and giving them so much "permissions" (its a ubuntu system )
But today something happened, that really turned her argument on its head. I was playing around with her (for a) "while" and was pipeing some data into her "while" (construct). Everything was working fine while I was inside her, but the moment I got out, it was as though everything changed. She has no memory of me and all the things I had did inside her. Half an hour of work and no final effect and I actually thought she was enjoying it. I was very frustrated and did it again and again, but to the same tune.
After that I finally decided to ask around and would you believe it? Others know her better than Me :(. It seems her “while” is a separate person, like her inner child or something, and it transforms her into someone else (sub-process) and what ever I pipe into her is lost the moment I get out
Are all she(ll)s in this world two faced?
Good night


Bwahaha! That’s awesome
I’m glad you found some inspiration in my blog post, even if it has nothing to do with actual scripting
I’m honoured that you used my article for this!
Comment by Cailin Coilleach — August 7, 2007 @ 4:12 pm
Trackback:
http://www.kilala.nl/viewcomments.php?id=686
Comment by Cailin Coilleach — August 7, 2007 @ 4:24 pm
Hi there
Am glad that you liked it (you did…didnt you? :P) ….some of my friends thought I overdid it a bit , to which I thought only a “bit”???
as far as your he/she question….i am a “he” :P….How you could even imagine a “she” writing such a sexist article is beyond me
btw I AM NOT A NERD
but still i could empathize with what a nerd would have felt after spending so much time trying to figure out what went wrong in a innocuous piece of code….and your article was heaven sent
Comment by cafm — August 7, 2007 @ 5:51 pm
That is funny. Good stuff.
Comment by jeffx — August 8, 2007 @ 2:19 am