LINUX programming

Moderators: ITA
Number of threads: 1339
Number of posts: 2924

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: Simple Shell in C++ Posted by bragr on 25 Oct 2010 at 2:44 PM
I found that my problem was that I was secretly seg faulting in the child, which was causing the child to silently fail. The code works if you substitute the strcpy() with "arglist[x] = strdup(tok[x].c_str());" which actually allocates memory. The pipes are only needed for commands like "ps aux | grep bragr" in which the output of one child needs to be piped to the input of another.
Thread Tree
bragr Simple Shell in C++ on 19 Oct 2010 at 2:02 PM
bragr Re: Simple Shell in C++ on 25 Oct 2010 at 2:44 PM
blkhd32 Re: Simple Shell in C++ on 14 Apr 2011 at 6:52 PM
bragr Re: Simple Shell in C++ on 14 Apr 2011 at 8:22 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.