How to get the output of a command?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manjuks
    New Member
    • Dec 2007
    • 72

    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,
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Is it outputting anything? If so, try redirecting it to a file.

    Comment

    • manjuks
      New Member
      • Dec 2007
      • 72

      #3
      Hi,

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

      Thanks,
      Manjunath

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Ok, then what you were grepping for, how you grepped for it, does not exist.

        Comment

        Working...