If you want a very quick intro into shell scripts try this http://pegasus.rutgers.edu/~elflord/unix/bash-tute.html
Also if you want to learn more about bash in general - http://www.gnu.org/manual/bash-2.05a...shref_toc.html
If you want a very quick intro into shell scripts try this http://pegasus.rutgers.edu/~elflord/unix/bash-tute.html
Also if you want to learn more about bash in general - http://www.gnu.org/manual/bash-2.05a...shref_toc.html
just cant believe how good this forum is.
Thanking you so much . . i'll have a look and pick out the relevant information. if i need more help, i'll definitely ask
ober5861: even though u spoiled our aussie thread, i have to thank you for trying to help.
anytime Hermit, anytime
EntropySink. You know you have to click it.
Okay i got abit confused. I am suppose to write a program that act like shell in C
I need to use fork, strtok, wait, execvp, how am i going to implement that?
fork will create a parent and child process, correct me if i am wrong. I understand the logic, but how do i code it
PM me... I'll check my code when I get home...
Have you ever used fork before? Basically, fork creates a child process and returns to PIDs... which you can use to run certain parts of your program... I can't remember which is which... but I think one returns 0 or 1 and the other returns a random number... I'll post some code later... it's really not that hard.
EntropySink. You know you have to click it.
Basic fork example (code is in no way complete):
There are pleny of complete examples around.Code:pid_t pid; switch (pid = fork()) { case -1: perror("fork failed"); return (EXIT_FAILURE); break; case 0: /* * We're in the child, do whatever */ break; default: /* * We're in the parent, do whatever */ break; }
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
here's my shell I wrote... I called it "obesh"... obe... shell?
EntropySink. You know you have to click it.
Yes, and I'd like to thank you too, ober - I've got that class next term
-Govtcheez
[email protected]
yeah... well it's not completely working... tho what I did have working got me like 34 out of 40 points...
EntropySink. You know you have to click it.
yeah... and I ruined it... whatcha gonna do about it?
EntropySink. You know you have to click it.