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...
Type: Posts; User: ohaqqi
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...
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...
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...
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...
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...
doh. I had tried scanf("%s%s%s") before, I guess the space makes a difference?
I'll try investigating fgets as well. thanks!
Should I use something other than scanf?
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...
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...
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...
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...