PDA

View Full Version : "ls -pa | grep ./" implement in C


non3
10-07-2004, 04:38 AM
I've been trying to figure out how to implement "ls -pa | grep ./" in C. I tried reading up on pipes, but it got really confusing. The other option I thought about was writing "ls -pa" to a file and doing "grep ./ filename.txt" but im also not very sure how to write the output stream of a function to a file in C.

The only language I know is Java. =(

Thanks for the help,
Frank

sir pannels
10-07-2004, 09:20 AM
Ok, to save some hassel... why exactly do you need to do this in C?... what are you running these commands in? I'm assuming you are either in the shell or remotly accessing using telnet?

non3
10-07-2004, 04:36 PM
I am trying to write a shell in C for use in a UNIX environment.

Thanks