Find the answer to your Linux question:
Results 1 to 2 of 2
hi, I want to execute a command 'lsof | grep filename' in my c program . How can i do it?...
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    3

    Exclamation How to execute a command in .c file

    hi,

    I want to execute a command 'lsof | grep filename' in my c program . How can i do it?

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Simple: int system(const char *command);

    Powerful: The GNU C Library - Child Processes
    Debian GNU/Linux -- You know you want it.

Posting Permissions

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