LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2011, 11:28 PM   #1
SANA4SPA
LQ Newbie
 
Registered: Jul 2011
Posts: 20

Rep: Reputation: Disabled
Help with running ps -e | less on nano script editor


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. 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
 
Old 10-21-2011, 11:41 PM   #2
nguyeng
LQ Newbie
 
Registered: Jan 2011
Distribution: Slackware
Posts: 18

Rep: Reputation: 1
press 'q' to exit less?
 
1 members found this post helpful.
Old 10-22-2011, 10:56 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,834

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
nguyeng is right. The next line in a script won't execute until the current command exits (unless you background it), and less requires user-interaction to terminate. If you want the pager to automatically exit when you scroll to the end, use more, or perhaps less -e.

Also, please use [code][/code] tags around your code, to preserve formatting and to improve readability.
 
1 members found this post helpful.
Old 10-22-2011, 07:29 PM   #4
SANA4SPA
LQ Newbie
 
Registered: Jul 2011
Posts: 20

Original Poster
Rep: Reputation: Disabled
It worked thank you both.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to create a data file with all entered users information. Nano script editor SANA4SPA Linux - Newbie 5 09-05-2011 01:44 AM
linux nano editor himanshugarg04 Linux - Software 4 11-05-2009 08:09 AM
Is there a way to get the mouse to work in nano? or use a different editor? thriftee Debian 14 01-27-2009 09:02 AM
Nano Editor Question swamprat SUSE / openSUSE 7 01-17-2007 05:24 PM
nano editor not working FlashAsh99 Linux - General 2 06-27-2005 03:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration