Tuesday Sep 23, 2008

Is there a shell problem in nevada builds of late? 

bash-3.2# su mysql
 $ bash
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
bash: /root/.bashrc: Permission denied

 Compare this with S10 :

bash-3.00# su mysql
$ bash

I am wondering why it is trying to access root's .bashrc.  This problem seem to send all my scripts into a tizzy.

Saturday Apr 12, 2008

I had an interesting conversation with our quality architect for automating a new feature that we are working on.  We were discussing the choice of programming language to use. Given the complexity of the Solaris Cluster product, we have automation based on Java, C, Perl and shell scripts.

For some of the BUI/GUI tools, Java is the best choice.  For others one could either use shell scripts or  C programs.  C programs are easier to code for automating kernel level components.  But the downside is that any bug in the code causes core dumps and it is difficult for people without knowledge of C programming to decode and find workarounds temporarily and continue with testing. This results in delay till the time the QE identifies a fix/workaround.

On the other hand, scripting is the round about way for kernel level components and takes a lot of time to develop.  But debugging it is easy and maintenance is lot more easier.

So what will be your choice? If you have some interesting insights or experience, please leave a comment!

Monday Apr 07, 2008

I encountered a rather unusual situation that made me realize that my understanding of "cut" command is not as good as I thought it to be! 

 Take this example:

bash-3.00#  strings /usr/apache/bin/httpd |grep SERVER_CONFIG_FILE|cut -f2 -d"="
"/etc/apache/httpd.conf"

Now from the above output, I assume that there is just one field and that too it is within the delimiter "

Not so as per the following output:

bash-3.00#  strings /usr/apache/bin/httpd |grep SERVER_CONFIG_FILE|cut -f2 -d"="|cut -f1 -d"\""

bash-3.00#

So by simple trial and error method, I right shift field by one and give field# as 2:

bash-3.00#  strings /usr/apache/bin/httpd |grep SERVER_CONFIG_FILE|cut -f2 -d"="|cut -f2 -d"\""
/etc/apache/httpd.conf

Any expert opinion on this behaviour?
 

This blog copyright 2009 by maddy