LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-25-2009, 10:21 AM   #1
jesus1me
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Smile 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.
 
Old 06-25-2009, 10:35 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
int main( int argc, char *argv[])
{
char array[1024];
FILE *fp = popen("ls", "r");
array= fgets(array, sizeof(buffer), fp);
pclose(fp);
}
 
Old 06-25-2009, 10:45 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Output rpm cmd listing onto a CD? flasun Linux - Newbie 2 02-12-2009 07:57 AM
files are created in the future while date cmd output is perfectly fine zvika Linux - Newbie 1 10-16-2008 12:03 PM
bash: put output from `ls` into an array samel_tvom Programming 18 07-31-2005 01:55 AM
store output of cmd in array? h/w Programming 6 10-09-2003 09:46 PM
Awk and Shell CMD Output xanthium Programming 16 04-24-2002 07:13 AM


All times are GMT -5. The time now is 10:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration