Search:

Type: Posts; User: ohaqqi

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    4,719

    using strtok with \n

    Hi guys, I'm trying to figure out the problem with my C code below
    implementing strtok(). I am trying to read in a CSV text file which
    contains information separated by commas and \n newlines. In...
  2. Replies
    9
    Views
    6,252

    thanks for the tips, I finally got the cat...

    thanks for the tips, I finally got the cat command to work...that link was great. I'm having a problem with the child process creation now :(

    I have testfile.txt to verify that the cat command...
  3. Replies
    9
    Views
    6,252

    using execvp()/fork() to catenate a file

    Hi guys,
    I'm still working on my shell. I'm trying to implement a function typefile that will take a command line input as follows:

    > type <file1>

    This command will implement a catenation of...
  4. Replies
    15
    Views
    11,456

    Thanks for the tip. It's not really my own shell,...

    Thanks for the tip. It's not really my own shell, just something basic that implements a copy and delete command. I can do those I think, it's the parsing of the command line that's causing me...
  5. Replies
    15
    Views
    11,456

    I think this may not work as well as strtok...

    I think this may not work as well as strtok because it requires 3 strings to be input and needs termination after each string. If the user enters <exit> and nothing else, this scanf function will...
  6. Replies
    15
    Views
    11,456

    doh. I had tried scanf("%s%s%s") before, I guess...

    doh. I had tried scanf("&#37;s%s%s") before, I guess the space makes a difference?
    I'll try investigating fgets as well. thanks!
  7. Replies
    15
    Views
    11,456

    Should I use something other than scanf?

    Should I use something other than scanf?
  8. Replies
    15
    Views
    11,456

    I redid my code and it partially works right now....

    I redid my code and it partially works right now. I can use strtok to find the first input in the command line, but cannot get the arguments.

    The format is <command> <arg1> <arg2>

    So far, I've...
  9. Replies
    15
    Views
    11,456

    So how can I break the user input into 3 (or...

    So how can I break the user input into 3 (or less) strings? I'm trying to check if the user terminated his input at that point.
    Should I get rid of the while loop and put if(&token == NULL) after...
  10. Replies
    15
    Views
    11,456

    Sorry about that, here's a compilable snippet....

    Sorry about that, here's a compilable snippet. I'm only trying to make sure the parsing works. It should exit when the user types exit<ENTER>.


    #include <stdio.h>
    #include <string.h>
    #include...
  11. Replies
    15
    Views
    11,456

    trying to use strtok() function to parse CL

    Hi everybody. I haven't programmed anything in about 8 years, I've read up a little bit on C and need to write a shell in C. I want to use strtok() to take an input from a user and parse it into the...
Results 1 to 11 of 11