LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   print or put output of CMD like ls into an array (https://www.linuxquestions.org/questions/linux-newbie-8/print-or-put-output-of-cmd-like-ls-into-an-array-735563/)

jesus1me 06-25-2009 09:21 AM

print or put output of CMD like ls into an array
 
The last response to this question was 8 years old.

Is there anything new?


Thanks in advance.

Agrouf 06-25-2009 09:35 AM

int main( int argc, char *argv[])
{
char array[1024];
FILE *fp = popen("ls", "r");
array= fgets(array, sizeof(buffer), fp);
pclose(fp);
}

David the H. 06-25-2009 09:45 AM

What environment are you talking about here, shell scripting or some programming language? And why should you think anything important has changed about it in 8 years? Why didn't you link to the thread you're referring to?

In other words, how about giving us some background so we can understand why you asked the question?

In any case, I see at least two threads more recent than that in the "similar threads" box at the bottom of the page that seem to fit the topic here.


All times are GMT -5. The time now is 01:19 AM.