Superior Quality Unbeatable Interprocess (communication) Shell, or "squish", is a shell that supports running proceses, piping between processes, handle redirection, support variable globbing, support cd and exit. This shell is compatible on Mac OS and Linux
Superior Quality Unbeatable Interprocess (communication) Shell, or “squish”, is a shell that supports running processes, piping between processes, handle redirection, variable globbing, cd and exit.
make
./squish
For ex. p1 | p2 | p2
can be represented as:
squish
/\
/ \
/\ p3
/ \
p1 p2
Pseudo-code follows as such:
ipc (tokens, nTokens)
{
if ( nTokens == 1 ) {
fork new process
exec ( tokens[0] )
return
}
fork new process
if ( pid == 0 ) {
replace stdout with write end of pipe
ipc (tokens, --ntokens)
}
fork new process
if ( pid == 0 ) {
replace stdin with read end of pipe
exec ( tokens[nTokens] )
}
}
squish_main.c
squish_run.c
squish_tokenize.c
w_change_dir.c
w_exit.c
w_glob.c
w_pipe.c
w_redirection.c
w_run.c
w_run_command.c
Some of the code is copied from the cis-3050 c examples from the linux.socs server. Wherever that is the case, a comment block will be included above the code snippit.