LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 10: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, 10: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, 09:56 AM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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, 06:29 PM   #4
SANA4SPA
LQ Newbie
 
Registered: Jul 2011
Posts: 20

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


Reply



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 12:44 AM
linux nano editor himanshugarg04 Linux - Software 4 11-05-2009 07: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 08:02 AM
Nano Editor Question swamprat SUSE / openSUSE 7 01-17-2007 04:24 PM
nano editor not working FlashAsh99 Linux - General 2 06-27-2005 02:40 PM

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

All times are GMT -5. The time now is 07:39 AM.

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
Open Source Consulting | Domain Registration