shell.c code reduction