When I execute the script2 the more command does not print pagewise it goes to the end of the line, when I remove the tee command it works fine but we need to capture the standard output and error into tee.log.
Is there any workaround or solution for this requirement, to get the output pagewise on screen as well capute the output into tee.log
Thanks for the reply,
I won't be able to use more in the script2 as you suggested, because the script1 is menu driven, [It's not shown to keep it simple for the problem]
Script1:
echo "\t 1 = Users list"
echo "\t "
echo "\t 2 = Session list"
echo "\t "
echo "\t 3 = Advanced Menu"
echo "\t "
echo "\t e = Exit"
echo "\t "
echo "\t Please enter your choice==> \c"
read answer
.............................<more code>............
echo "\n\tDo you want to view the users list (y,n)?\c"
read ANS
if [ "${ANS}" = "Y" -o "${ANS}" = "y" ]; then
clear
echo "\tNOTE:Press q to exit from viewing\n"
cat ${USER_LIST_FILE} | more
fi
In one of the step, it asks for user to view the file that's where more command is used so that the user can view the file and enter the requirement parameters.
Thanks for the suggestion, I will correct the code to just use
more "$USER_LIST_FILE"
So to the real problem printing the output on the screen and capturing the tee.log, from your reply, it looks like we don't have a solution/workaround for this.