Search:

Type: Posts; User: LightsOut06

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    5,483

    goto's are evil. please learn loops.

    goto's are evil. please learn loops.
  2. Replies
    11
    Views
    9,772

    what is m[i]? and what is n? You're getting a seg...

    what is m[i]? and what is n? You're getting a seg fault probably because you for loop is trying to put a value in some space that is not allocated.
  3. Replies
    4
    Views
    1,825

    i know this code is long, if anybody wants me to...

    i know this code is long, if anybody wants me to explain my thought process or something over aim or yim, pm me or something. I'm pretty desperate over here.
  4. Replies
    4
    Views
    1,825

    here's the output: Pipe0 got completed...

    here's the output:



    Pipe0
    got completed
    freeze before closes?
    freeze before closes?
    executing command ls
    freeze before dupes and closes?
  5. Replies
    4
    Views
    1,825

    updated code still not working. I dont know what...

    updated code still not working. I dont know what is wrong. I just cant get it working at all. Please any help or suggestions would be greatly appreciated. I've googled and googled, recoded and...
  6. Thread: pipes in c

    by LightsOut06
    Replies
    6
    Views
    4,688

    sorry to bump a really old thread, but how would...

    sorry to bump a really old thread, but how would you implement this using dup2s and closes?
  7. Replies
    4
    Views
    1,825

    changed the code to use 2d arrays // Program...

    changed the code to use 2d arrays


    // Program asks user for input and tries to execute linux commands based on that input
    // User can use multiple input piped commands ie ls | grep main | grep...
  8. Replies
    4
    Views
    1,825

    Another pipe() problem.

    For some reason pipe() is returning an error when I try to pipe. Any idea why? Here's the code:


    // Program asks user for input and tries to execute linux commands based on that input
    // User...
  9. Thread: Internship

    by LightsOut06
    Replies
    15
    Views
    4,223

    same way at my school. I honestly know waaaay...

    same way at my school. I honestly know waaaay more people with gpas under 3.0 than over 3.0 (i go to an engineering school btw Univ Missouri-Rolla).
  10. im in the midwest. St. Louis, Missouri.

    im in the midwest. St. Louis, Missouri.
  11. Computer Science Degree but no experience. What to do?

    I haven't obtained my degree yet, but this is the situation im looking at and it's really bothering me. I would hate to have wasted 5 years of my life working so hard to obtain this comp sci degree...
  12. Replies
    3
    Views
    7,433

    problems with multiple pipes.

    This problem works with 2 piped commands (ie ls | grep main) but when I try to do more than 2 commands the program freezes.The int main() basically does the i/o and the execute command function is...
  13. Replies
    0
    Views
    2,050

    Problem with multiple pipes...

    This problem works with 2 piped commands (ie ls | grep main) but when I try to do more than 2 commands the program freezes.The int main() basically does the i/o and the execute command function is...
  14. thanks a bunch. everything works now!

    thanks a bunch. everything works now!
  15. converting a vector of strings into an array.

    vector<string> left_args;

    //left_comm_toks is a vector that stores strings.
    // GetNumTokens returns the size of the left_com_toks vector
    for(int i = 0; i < left_comm_toks.GetNumTokens(); i++)...
  16. Replies
    10
    Views
    3,665

    i know what execvp accepts. My problem is that I...

    i know what execvp accepts. My problem is that I have a C++ style string not const char *, or char *const argv[]. I wouldnt to know how to convert the string into something execvp can accept. There...
  17. Replies
    10
    Views
    3,665

    i tried that that's still not what execvp wants...

    i tried that that's still not what execvp wants for the second arg.
  18. converting a c++ style string into something execvp can use for args.

    I'm trying to use execvp which has the prototype:

    int execvp( const char *file, char *const argv[]);

    I'm using a C++ style string to get input from the user. How can I convert this C++ style...
  19. Replies
    10
    Views
    3,665

    Converting C++ Style strings...

    I'm trying to use execvp which has the prototype:

    int execvp( const char *file, char *const argv[]);

    I'm using a C++ style string to get input from the user. How can I convert this C++ style...
  20. Replies
    2
    Views
    5,749

    here is the addnode function btw: void...

    here is the addnode function btw:



    void addNode(char *input)
    {
    struct node *nptr;
    cptr = tptr;

    if ((nptr = malloc(sizeof(struct node))) != NULL)
  21. Replies
    2
    Views
    5,749

    Why wont my function exit correctly?

    void RunShellLoop(struct prompt *pr)
    {
    Bool stillGoing = TRUE;
    Bool execvp_worked = FALSE;
    ssize_t readReturn = 0;
    char *input = NULL;
    char *lastCommand = NULL;
    char...
  22. Replies
    3
    Views
    3,997

    the problem was that i never forked a new...

    the problem was that i never forked a new process. I dont know how i left that out lol.
  23. Replies
    3
    Views
    3,997

    here's some more code that exemplifies what i'm...

    here's some more code that exemplifies what i'm trying to do. Still having the same problem.



    #define _GNU_SOURCE 1
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include...
  24. Replies
    3
    Views
    3,997

    Problems with execvp and fork....

    Bool execute_command(char *input)
    {
    pid_t child_pid;

    /* fork() == 0 for child process */

    if(child_pid == 0)
    {
    char *argv[]={input, 0};
    execvp(argv[0], argv);
  25. Replies
    5
    Views
    1,084

    ^i think getline automatically does that. ...

    ^i think getline automatically does that.

    However I think I fixed it. Thanks to Salem. I looked at his last post in my last thread and he said to make input = NULL before you loop again. That's...
Results 1 to 25 of 41
Page 1 of 2 1 2