LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 09: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, 09:35 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596

Rep: Reputation: 80
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, 09:45 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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



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 06:57 AM
files are created in the future while date cmd output is perfectly fine zvika Linux - Newbie 1 10-16-2008 11:03 AM
bash: put output from `ls` into an array samel_tvom Programming 18 07-31-2005 12:55 AM
store output of cmd in array? h/w Programming 6 10-09-2003 08:46 PM
Awk and Shell CMD Output xanthium Programming 16 04-24-2002 06:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 PM.

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
Open Source Consulting | Domain Registration