Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Linux Programming
  4. How to redirect command output - general reference wanted...

How to redirect command output - general reference wanted...

Scheduled Pinned Locked Moved Linux Programming
questionlearninghelptutorialc++
2 Posts 1 Posters 14 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    system(3) - Linux manual page[^]

    This is somewhat a dupe, so if it bothers you...( I am not allowed to give instructions ...) I am asking for generic / general help in capturing Linux command output. I am going to use this as an example:

    system("hcitool dev | cut -sf3 ");

    I know what is does - that is NOT of my concern.. I can see the result in (Qt) console... I do not know HOW - what "hidden" code (std??) put the actual result of the call onto console and how can I redirect such call for my purpose ? I did RTFM for "system" and found NO references , or missed them, on how to capture THE actual output of the command. that said - what would be SUCCESSFUL phrase to ask Mrs Google to give me a general Linux resource ( text book ?) to cover "standard output / input / error " and how to figure out if the command uses

    "standard output / input / error "

    and how to access it in C/C++ ..all this just for learning purpose CHEERS THANks

    L 1 Reply Last reply
    0
    • L Lost User

      system(3) - Linux manual page[^]

      This is somewhat a dupe, so if it bothers you...( I am not allowed to give instructions ...) I am asking for generic / general help in capturing Linux command output. I am going to use this as an example:

      system("hcitool dev | cut -sf3 ");

      I know what is does - that is NOT of my concern.. I can see the result in (Qt) console... I do not know HOW - what "hidden" code (std??) put the actual result of the call onto console and how can I redirect such call for my purpose ? I did RTFM for "system" and found NO references , or missed them, on how to capture THE actual output of the command. that said - what would be SUCCESSFUL phrase to ask Mrs Google to give me a general Linux resource ( text book ?) to cover "standard output / input / error " and how to figure out if the command uses

      "standard output / input / error "

      and how to access it in C/C++ ..all this just for learning purpose CHEERS THANks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What I already suggested in my amswer to How do I redirect "system" call output ?[^].

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups