getchar and getline functions implemented for shell