p { margin-bottom: 0.08in; } This is just a portion of a script I'm writing on Linux nano script editor. When I run the script I get stuck on the ps -e | less command portion of the script:wall:. It displays all the process running but it does not allow me to move to the next line on the script. when it gets to the end of the display all I get is [END] I hit enter but it has no effect. Is there an option I must use?
Thank you
if [ "$answer" = "yes" ]
then
ps -e | less
echo -e "\n\nWhich process would you like to terminate?:\c"
read PID
exit 0
else
display
fi
done
I'm not familiar with 'nano,' so maybe it's an interface issue, but it sounds like you need to type 'q' to get less to stop.
You could try running less with the -E option which won't write the end, nor will it wait for you to acknowledge the end with a 'q,' but it does tend to return the tty back to the original state when it reaches the end of the file, rather than leaving the tail of the file on display, which might not let you see what you are looking for. You could always go old school and pipe it to more which is more likely to behave as you are expecting it to.