Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I'm programing a C gnu/linux program and I need to execute this command: " find /home/javi/ -name "dmtcp_restart" | grep dmtcp/bin/dmtcp_restart" when the command has been executed I need ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    1

    assign path to a variable in C program


    Hello,

    I'm programing a C gnu/linux program and I need to execute this command:

    " find /home/javi/ -name "dmtcp_restart" | grep dmtcp/bin/dmtcp_restart"

    when the command has been executed I need to assign the output of the command to a array char variable.

    What linux instructions could be used for obtain this??

    regards

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Try the popen C function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •