How to read keyboard input shift M in script when run top in linux
Hi, guys, I type in 'top' in linux terminal and then press shift M, it will sort memuse.
I want to let all this process run automatically in a script 1.csh and output the sorted-result into a file such as 1.log. so I write 1.csh script which content is as follows:
then I run 1.csh, but there will emerge a error : top failed tty get.I don't know how to solve this problem, anyone can help me? thanks in advance with any information.
top << EOF > 1.log