Subshells
The shell is just a program. It's not wired into the kernel. Many programmers who've been in the business for a while have written a shell, for their own amusement. If you haven't, you can imagine the pseudocode.
This week, I'll explore that a little.
Thinking of the shell as just another program, no different from ls or date or cc, is a big help in dealing with the shell.
while (1) {
put up a prompt
read the line the user types in
parse the line
execute any commands you find
}
This week, I'll explore that a little.
0 Comments:
Post a Comment
<< Home