A
Advocated
Hey all, thanks for taking the time to read this in the first place.
Anyway, ill try and keep it simple. In my program, if i type $ man something
it should read in the 2 words, man and something
it should look up man - find that its a function, run the man function, and
then, with that second word "something" it should then execute that as its
parameters, if that make sense.
At the moment, it semi works, i.e If i type man it will run the function i
want, but i cant work out where to go next, im not even sure if the method
is right.. Any ideas?
The way i see it is that the first word/token is the command or function,
the 2nd, maybe third and so on, are its paremeters.
A way to describe it could be if i were to type: dir /p /w so it would run
the dir function, use /p as its first param, and then so on. Hope this makes
sense
Thanks for any advice or ideas.
[Code has been uploaded]
http://tinyurl.com/29u5z
(this code is not my original code and has been provided by a Lecturer with
permission to modify)
Anyway, ill try and keep it simple. In my program, if i type $ man something
it should read in the 2 words, man and something
it should look up man - find that its a function, run the man function, and
then, with that second word "something" it should then execute that as its
parameters, if that make sense.
At the moment, it semi works, i.e If i type man it will run the function i
want, but i cant work out where to go next, im not even sure if the method
is right.. Any ideas?
The way i see it is that the first word/token is the command or function,
the 2nd, maybe third and so on, are its paremeters.
A way to describe it could be if i were to type: dir /p /w so it would run
the dir function, use /p as its first param, and then so on. Hope this makes
sense
Thanks for any advice or ideas.
[Code has been uploaded]
http://tinyurl.com/29u5z
(this code is not my original code and has been provided by a Lecturer with
permission to modify)