getchar and getline functions implemented for shell

Can be applied to trunk?