Gang's Tech Stuff

To run a shell script in DEBUG mode, put “-x” option at the end of the interpreter in the first line.

#!/usr/local/bin/sh –x

This is going to print the steps the compiler goes through.

The “default” case in a switch case need not be perfect by its spelling. If none of the cases satisfy the condition, the compiler will search for “default” case. If its there, it’ll execute that block. In case you have miss spelled it [may be in hurry! ;)], the compiler won’t give any error, but it won’t go for that block as it is not “default” block.

So be careful while using switch statement.

“stdout” flushes the data to be printed to standard output device only after getting an new line character. If it wont get a new line character, it waits until the program ends, then it flushes the data.

Ex:

Code:

#include<stdio.h>

int main()

{

    fprintf(stdout,”hello-out1 \n”);

    fprintf(stdout,”hello-out2 “);

    fprintf(stderr,”hello-err “);

    return 0;

}

 

Output:

    hello-out1

    hello-err hello-out2

ipcs:

To display the shared memory and semaphores.

ipcrm:

To remove the shared memory and semaphores present in the memory.

Background:

When we will be using large database, there is a tendency to use shared memory concept to speed up the response time.
After updating the database, if the new item didn’t reflect in the list, try clearing the shared memory and semaphores, by using the above mentioned commands.
There are some options related to these commands, just see the manual pages of these commands.

df: To check the disk free in a directory.


  • Rami Reddy: check whether are you dissable windows firewall or not, if enables windows firewall then you have to dissable then you can access clearcase
  • Henri Hein: Nice tip!
  • Lance Elot: Can you tell me a way by which I can store current time in a text file(file.txt) & then execute a command exactly in one hour(or any specified tim

Categories