The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing a script through GUI snvijaysankar UNIX for Dummies Questions & Answers 2 06-02-2008 01:49 AM
[AIX] executing script piooooter UNIX for Dummies Questions & Answers 1 05-25-2006 09:53 PM
executing script big123456 Shell Programming and Scripting 1 06-03-2005 04:32 AM
RSH use for executing a script frustrated1 Shell Programming and Scripting 6 10-02-2003 05:24 AM
Executing ksh script from cgi hodges Shell Programming and Scripting 1 05-27-2003 07:57 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-21-2001
Registered User
 

Join Date: Nov 2001
Posts: 3
Executing Ps in script

Im Sorry to bother you guys butim totally new to Unix, so pls help me out if you can. This could be a silly question.

I wanna run the command "ps" in script, but how should I be able to do so? Actually I have made a menu for the user to choose from...for example


1. Show all processes
2. Kill process
.
.
.
N. XXX

I want to get it done when the user chooses option one and it will show him the processes currently running.

Thx!
Reply With Quote
Forum Sponsor
  #2  
Old 11-21-2001
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
You can check out <a href="http://www.unix.com/showthread.php?s=&threadid=2626"><b>this</b></a> thread for more information on menus... Also, check out the <a href="http://www.unix.com/search.php?s="><b>search</b></a> funtion for more examples. I searched for "menu case" to get the above example.

Keep in mind that since the output of the `ps -e` command is usually longer than one screen, you might want to pipe it through `more` or `less` for the user, if you use those options.
Code:
ps -e | more
See the manual page for `ps` (man ps) for more information on formatting.

BTW, hope this isn't a hmework question... those are frowned upon.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0