User Profile

Collapse

Profile Sidebar

Collapse
manjuks
manjuks
Last Activity: Jul 12 '12, 04:51 AM
Joined: Dec 4 '07
Location: Chennai India
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • manjuks
    replied to How to get the output of a command?
    Hi,

    I got below error
    grep: received": No such file or directory

    Thanks,
    Manjunath
    See more | Go to post

    Leave a comment:


  • manjuks
    started a topic How to get the output of a command?

    How to get the output of a command?

    Hi All,

    I need help in below command

    /bin/ping -c 2 -W 5 $remotehost | grep \"[12] received\"

    I just want to get the output out of the above command. Please can anybody help in this?

    1 received
    2 received

    Thanks & regards,
    See more | Go to post

  • manjuks
    started a topic Need help in ftp in Shell script

    Need help in ftp in Shell script

    Hi All,

    I am facing problem in ftp. I am porting code from Solaris to MV Linux, ftp behaves differently in both.

    script is in shell

    Code:
    if [[ "${OSname}" = "Linux" ]] ; then
            print "= ftp -n -i ${FtpMachine}" >> ${Log}
            ftp -n -i ${FtpMachine} <<-EOF >> ${Log} 2>&1
            user ${Login} ${Password}
            ...............
    ...
    See more | Go to post
    Last edited by numberwhun; Dec 24 '10, 04:06 PM. Reason: Please use code tags!

  • Hi thanks Jeff.
    It made me clear, In my case both MYVERSION[$I]and "$VERSION" are NULL. It means It should not go inside the for loop.

    But In Solaris KSH it was getting inside the for loop, and in Linux KSH it was not. Its because of KSH version mismatch.

    Thanks,
    Manjunath
    See more | Go to post

    Leave a comment:


  • manjuks
    started a topic Need to understand what this for loop will do?
    in Perl

    Need to understand what this for loop will do?

    HI All,

    Can any one please let me know what this for loop is trying to do

    for V in ${MYVERSION[$I]:-"$VERSION"}

    what :- stands for? I dont understand this condition,
    Can any one help me please?

    Thanks
    Manjuks
    See more | Go to post

  • manjuks
    replied to Need help for route command
    Hi ashitpro

    Thanks for your reply..

    Shall I replace this
    Code:
    $cmd = "/usr/sbin/route -n add -host $hoc -gateway $gatewayIp -setsrc $vcip";
    With this...

    Code:
    $cmd = "/sbin/route -n add -host $hoc -gw $gatewayIp" ;
    
    $dev = `netstat -ie | grep -B1 135.254.239.52  | head -n 1 | awk '{print $1}'`;
    
    $cmd = "/sbin/route add default gw
    ...
    See more | Go to post

    Leave a comment:


  • manjuks
    started a topic Need help for route command

    Need help for route command

    Hi All,

    I need help to port below command to LINUX, it was written for Solaris platform

    Code:
    $cmd = "/usr/sbin/route [B]-n[/B] add [B]-host[/B] $hoc [B]-gateway[/B] $gatewayIp [B]-setsrc[/B] $vcip";
    In Linux route command exists, and these add gateway options are available. But last option -setsrc is not available in LINUX. It represents “Assigns the default source address”, I didn't understand clearly... Can any one please...
    See more | Go to post

  • manjuks
    started a topic Need to format ouput
    in Perl

    Need to format ouput

    Hi All,

    I am trying to write wrapper for ptree in linux using pstree. I am ablet to get output something like tree format.

    I need suggestions on how can I reformat output of pstree to look same as ptree in solaris.

    Thanks
    Manjuks
    See more | Go to post

  • manjuks
    started a topic How to display device error statistics in linux

    How to display device error statistics in linux

    Hi,

    I am in a need of displaing device error statistics, is there any command in linux to do my job, like iostat -E does for Solaris?

    Thanks in advance,
    Manjunath
    See more | Go to post

  • manjuks
    started a topic Need kstat alternative in Linux
    in Perl

    Need kstat alternative in Linux

    Hi All,

    Is there any command like kstat (solaris) in linux? If not can you people guide me how I can write a script for the same...

    Thanks & Regards,
    Manju
    See more | Go to post

  • manjuks
    replied to Seriliazing threads
    in C
    Hi thanks weaknessforcats and donbock.
    I understood that the above code will not work, I just want to know weather mutex and semaphores are non preemptive?
    Wont it these get interrupted in between?
    See more | Go to post

    Leave a comment:


  • manjuks
    started a topic Seriliazing threads
    in C

    Seriliazing threads

    Hi All,

    I need some clarification on on mutex.

    Is it possible to use an normal locking (As shown in below code) to serialize access to critical section in threads.

    Code:
    int lock;
    if(lock!= 1){
       lock++;
       //do something here
       lock--;
    }
    if we cant use this to serialize threads, Can you please explain me or give me a pointer where i can read...
    See more | Go to post

  • manjuks
    started a topic Why sizeof is an operator rather than macro or function
    in C

    Why sizeof is an operator rather than macro or function

    Hi All,

    Why sizeof is called as an operator, why it can not be function or a macro?
    My assumption is type information is available at compile time, and to find out the size we need the type of object. Is it correct? or tell me why it must be an operator?

    Thanks & Regards,
    Manjunath
    See more | Go to post

  • manjuks
    replied to Problem in Free() on 2D array
    in C
    Thanks a lot Bafna. Now I understood whats the problem, and solved it.
    Thank you very much.

    Thanks
    Manjunath
    See more | Go to post

    Leave a comment:


  • manjuks
    replied to Problem in Free() on 2D array
    in C
    Hi Bafna,

    Thanks for the reply...
    Please have alook into the below full program.

    Code:
    #include<stdio.h>
    #include<stdlib.h>
    
    void allocate2D(int** array, int nrows, int ncols) {
    
         /*  allocate array of pointers  */
         printf("Allocating memory for array of pointers\n");
         array = ( int** )malloc( nrows*sizeof( int* ) );
    ...
    See more | Go to post

    Leave a comment:


  • manjuks
    started a topic Problem in Free() on 2D array
    in C

    Problem in Free() on 2D array

    Hi,

    Please see the below code snipet, its giving segmentation fault while freeying array[i]. Anybody help in whats going wrong?

    Code:
    void deallocate2D(int** array, int nrows) {
    
         /*  deallocate each row  */
         int i;
         for(i = 0; i < nrows; i++) {
              printf("deallocate each row %d\n",i);
              free(array[i]);
         }
    ...
    See more | Go to post

  • manjuks
    replied to How this peice of code will execute?
    in C
    Hi,

    Thanks a lot for your suggestions. I understood this properly.

    Thanks,
    Manjunath
    See more | Go to post

    Leave a comment:


  • manjuks
    started a topic How this peice of code will execute?
    in C

    How this peice of code will execute?

    Hi All,

    What is happening in the below piece of code
    Its printing Hello, why not world. Its working like call by value. Please clarify me on this.

    int main()
    {
    char *temp = (char *)malloc(sizeof ("Hello" + 1));
    strcpy(temp, "Hello");
    fun(temp);
    printf("temp = %s\n", temp);
    return 0;
    }
    void...
    See more | Go to post

  • manjuks
    started a topic Need help in pointer
    in C

    Need help in pointer

    Hi All,

    int *p = 100;

    printf("%d\n", *p) //It will give segmentation fault
    printf("%d\n", p) ; //It will print 100;

    here *p behaving as normal variable. why so?

    Thanks,
    Manjunath
    See more | Go to post

  • manjuks
    replied to Need help in writing to a file with delimeter
    in C
    That means, there is no library function like fprintf. We need to write our own function to accomplish this.

    Thanks,
    Manjunath
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...