new.cpp with io redirection/piping