shell.cpp code clarification