[Solved] Help with running ps -e | less on nano script editor


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] Help with running ps -e | less on nano script editor
# 1  
Old 10-22-2011
[Solved] Help with running ps -e | less on nano script editor

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 scriptSmilie. 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
Code:
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


Last edited by Franklin52; 10-22-2011 at 10:55 AM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 10-22-2011
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.
This User Gave Thanks to agama For This Post:
# 3  
Old 10-22-2011
Thank you, it worked great with the "q"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Vim, vi and nano editor shows help.txt automatically

Hi, Whenever i try to open a file in any editor like vi, vim and nano i get this help.txt showing up in split screen without any key being pressed. This continues to pop up even when i close the help.txt. This behavior happens only when i am connected via putty. Is there a fix to this issue? ... (1 Reply)
Discussion started by: sunil0391
1 Replies

2. Shell Programming and Scripting

[Solved] Running a R script with in a shell script

Hi, I do have an R script named KO.R. Basically reads thousands of files, whose name has a pattern that differs at a portion of the file name, List.txt. Row_file1_mile.txt Row_file2_mile.txt Row_file3_mile.txt ... ... Row_file1000_mile.txt Below is a portion of my Rscript that reads... (4 Replies)
Discussion started by: Kanja
4 Replies

3. Shell Programming and Scripting

[Solved] The SCRIPT command - Can we see the log file of a running session?

Hello. This is my situation. script .anything ls -l . ---How can I see the content of .anything using (i.e) cat .anything? If not possible can someone suggest a sequence to simulate a console-recorder to "observ" from a RUNNING script session? Thanks Paolo Please use code tags... (3 Replies)
Discussion started by: paolfili
3 Replies

4. Shell Programming and Scripting

[Solved] Running scripts in parallel

i have script A and script B, both scripts have to run in parallel, my requirement is script A create table temp1, post creating it will run fr 4 hrs , script B has to start 0nly after creation of table temp1 ( which is done by script A) , again script B will run for 5 hrs if i run sequencially... (7 Replies)
Discussion started by: only4satish
7 Replies

5. Shell Programming and Scripting

[Solved] Shell not running through cron

Hi freinds, I have tried running a script through cron ,it is a shell script which calls a oracle procedure , problem here is that there is function in sql code which makes a external C call , this function is failing when running manually but works when run manually. I have trouble shooted... (6 Replies)
Discussion started by: Jcpratap
6 Replies

6. UNIX for Dummies Questions & Answers

[Solved] How to Check if a script is running?

Hi All, I am new to Unix... Can you please let me know how we can check if a script is running or not on Solaris box? (4 Replies)
Discussion started by: Rahul466
4 Replies

7. Shell Programming and Scripting

[Solved] Looking for script running before I run script again

Good afternoon! I have a script in cron that runs every ten minutes. Normally it only takes a minute or so to complete. However there are times when the amount of data it is looking at is large, and it has taken 20 minutes. So I want for it to look for the script before it starts. I was... (8 Replies)
Discussion started by: brianjb
8 Replies

8. Shell Programming and Scripting

Need help with Bash scripting using nano editor

p { margin-bottom: 0.08in; } As you can already tell I am a newbie. I took a Microsoft VB2008 a few month back. Now I'm taking Linux + and this course requires me to write scripts. The script executes but, I can't figure out or have not found anything that I can make out on the internet that can... (4 Replies)
Discussion started by: SANA4SPA
4 Replies

9. OS X (Apple)

[Solved] Running shell code in AppleScript without Terminal

What I want my script to do is to run a command in Terminal and close that same Terminal window when the process is complete. Of course I could ad a delay of 6 seconds to complete the process, but it may not be enough every time. To simplify my question, this is what I want to achieve.... (9 Replies)
Discussion started by: ShadowofLight
9 Replies

10. Shell Programming and Scripting

[Solved] Error while running on Cron

All, I am running one perl script from prompt and its running fine, but while putting it on cron gives below error, DB-Library error: Could not open interface file. (2 Replies)
Discussion started by: Deei
2 Replies
Login or Register to Ask a Question