Originally Posted by noobie
and i'm guessing that result holds the value of the current token.. right?
My understanding is the token is a string, not a number, switch() takes a number.
Personally I would not do it like that....
I would have a loop what reads a logical line and splits it up into basically an argc/argv type array. Then check argv and match it in a table, if it's in the table, the table will have a function pointer to a handler, if not then just fork/exec and the argc/argv is already setup.
When you want to add macro expansion etc, just plonk that in the logical read line.