grep in Vxwork Shell - VxWorks

This is a discussion on grep in Vxwork Shell - VxWorks ; Hi, Is there any function in VxWorks shell that can be used like grep in unix, To filter the output of commands like >> i | grep "myTask" , so that I get only those lines for "myTask" Thanks in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: grep in Vxwork Shell

  1. grep in Vxwork Shell

    Hi,

    Is there any function in VxWorks shell that can be used like grep in
    unix, To filter the output of commands like >> i | grep "myTask" , so
    that I get only those lines for "myTask"

    Thanks in advacne


  2. Re: grep in Vxwork Shell

    No but you may use (download) a simple code that you have wrote
    to do it for you ...
    example :
    void myGrep(char *myTaskName)
    {
    int i, num_tasks;
    static int tid[MAX_TASKS];
    num_tasks = taskIdListGet(tid, MAX_TASKS); /* get all TIDs */
    for (i=0; i {
    if( strstr(taskName(tid[i]),myTaskName) )
    {
    printf("%#x %-40s\n",tid[i] , taskName(tid[i]) );
    }
    }
    }

    "Rahul" wrote in message
    news:1147928903.657491.220970@i40g2000cwc.googlegr oups.com...
    > Hi,
    >
    > Is there any function in VxWorks shell that can be used like grep in
    > unix, To filter the output of commands like >> i | grep "myTask" , so
    > that I get only those lines for "myTask"
    >
    > Thanks in advacne
    >




+ Reply to Thread