Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 267
added 36 characters in body
Source Link

im working on sun10 Solaris os,i have a process that returns table as by using this command dmh -q 12 the below:

*PROFILE   PRIORITY   COMM_TYPE     QID    # OF MSGS   ATTRIBUTES/VALUES*
      13        999          DC      24            3     32  1865
      13        999          DC      94            1     32  1665
      13        999          DC     157            0     32  1961
      13        999          DC     188            2     32  1784
      13        999          DC     293            0     32  1625
      13        999          DC     294           31     32  1950
      13        999          DC     713            0     32  1601
      13        999          DC     838            0     32  1607
      13        999          DC    1458            0     32  1855

here im trying to get the total count of messages and store it in the variable I have tried this but it doesn't work with me:

dmh -q 12 | grep -v'# OF MSGS' | wc -l 

the expected result should be 37

im working on sun10 Solaris os,i have a process that returns table as by using this command dmh -q 12 the below:

*PROFILE   PRIORITY   COMM_TYPE     QID    # OF MSGS   ATTRIBUTES/VALUES*
      13        999          DC      24            3     32  1865
      13        999          DC      94            1     32  1665
      13        999          DC     157            0     32  1961
      13        999          DC     188            2     32  1784
      13        999          DC     293            0     32  1625
      13        999          DC     294           31     32  1950
      13        999          DC     713            0     32  1601
      13        999          DC     838            0     32  1607
      13        999          DC    1458            0     32  1855

here im trying to get the total count of messages and store it in the variable I have tried this but it doesn't work with me:

dmh -q 12 | grep -v'# OF MSGS' | wc -l 

im working on sun10 Solaris os,i have a process that returns table as by using this command dmh -q 12 the below:

*PROFILE   PRIORITY   COMM_TYPE     QID    # OF MSGS   ATTRIBUTES/VALUES*
      13        999          DC      24            3     32  1865
      13        999          DC      94            1     32  1665
      13        999          DC     157            0     32  1961
      13        999          DC     188            2     32  1784
      13        999          DC     293            0     32  1625
      13        999          DC     294           31     32  1950
      13        999          DC     713            0     32  1601
      13        999          DC     838            0     32  1607
      13        999          DC    1458            0     32  1855

here im trying to get the total count of messages and store it in the variable I have tried this but it doesn't work with me:

dmh -q 12 | grep -v'# OF MSGS' | wc -l 

the expected result should be 37

Source Link

get count with grep

im working on sun10 Solaris os,i have a process that returns table as by using this command dmh -q 12 the below:

*PROFILE   PRIORITY   COMM_TYPE     QID    # OF MSGS   ATTRIBUTES/VALUES*
      13        999          DC      24            3     32  1865
      13        999          DC      94            1     32  1665
      13        999          DC     157            0     32  1961
      13        999          DC     188            2     32  1784
      13        999          DC     293            0     32  1625
      13        999          DC     294           31     32  1950
      13        999          DC     713            0     32  1601
      13        999          DC     838            0     32  1607
      13        999          DC    1458            0     32  1855

here im trying to get the total count of messages and store it in the variable I have tried this but it doesn't work with me:

dmh -q 12 | grep -v'# OF MSGS' | wc -l