- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Widening the column scope for ps -ef | grep call
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 11:45 PM
тАО08-11-2004 11:45 PM
Widening the column scope for ps -ef | grep call
I'm trying to grep for a string output from a ps -ef call, however since the column width of the terminal/console is 80(?) characters the grep fails to find the string because the end of the line is chopped off.
For example:
ps ef | grep $1
On other Unix/Linux platforms I can normally modify the COLUMNS environment to an arbitarily high value, say 300. The result is that the grep finds the string as it isn't "lost" off the end of the terminal.
On HP though, this doesn't work. Is there an alternative way of achieving this behaviour?
Many thanks in advance
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 11:48 PM
тАО08-11-2004 11:48 PM
Re: Widening the column scope for ps -ef | grep call
Try the unix95 in ps something like this
echo memory usage per process
echo "----------------------------------------------"
UNIX95= ps -e -o stime,ruser,vsz,sz,pid,ppid,tty,args > /tmp/$PPID
head -n 1 /tmp/$PPID
tail -n +2 /tmp/$PPID|
sort -rn
/bin/rm /tmp/$PPID 2>/dev/null
Then you can get what you seek
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 11:56 PM
тАО08-11-2004 11:56 PM
Re: Widening the column scope for ps -ef | grep call
You might also want to look at using
ps -efx grep $1
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 12:27 AM
тАО08-12-2004 12:27 AM
Re: Widening the column scope for ps -ef | grep call
if you put ps ef it will give the ps command result only.
To get more extended format use as,
ps -efl | grep -v grep | grep $1
You have to use grep -v grep to avoid on getting grep process too.
or
ps -efx | grep -v grep | grep $1
It will not chomp the output anyway.
If so let us know about that by tunning COLUMNS environment variable too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 12:40 AM
тАО08-12-2004 12:40 AM
Re: Widening the column scope for ps -ef | grep call
# ps -efx | grep LaunchFile
ps: illegal option -- x
usage: ps [-edaflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup]
Thanks
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 12:53 AM
тАО08-12-2004 12:53 AM
Re: Widening the column scope for ps -ef | grep call
Thanks
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 01:12 AM
тАО08-12-2004 01:12 AM
Re: Widening the column scope for ps -ef | grep call
You didn't mention what version of HP-UX you're using. I assume, since the -x option was not available to you, you must be on 11.0 or earlier. The following document details the extension for 11i:
http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063200617
In case you can't retrieve that, I'll quote the pertinent part:
"While there is no other solution for 11.00, the option -x extends the COMMAND field to 1024 characters on 11.11"
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 01:22 AM
тАО08-12-2004 01:22 AM
Re: Widening the column scope for ps -ef | grep call
The latest 'ps' cumulative patch for HP-UX 11.11 is PHCO_30397
http://www1.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main|patch.breadcrumb.search|&patchid=PHCO_30397&context=hpux:800:11:11
The latest 'ps' cumulative patch for HP-UX 11.0 is PHCO_30559
http://www1.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main|patch.breadcrumb.search|&patchid=PHCO_30559&context=hpux:800:11:00
Be sure to check all of the patch dependencies as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 01:22 AM
тАО08-12-2004 01:22 AM
Re: Widening the column scope for ps -ef | grep call
Yes, I'm running with 11.00.
Oh, well...
Many thanks for your help
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2004 03:09 AM
тАО08-12-2004 03:09 AM
Re: Widening the column scope for ps -ef | grep call
XPG4 Synopsis
ps [-aAcdefHjlPx] [-C cmdlist] [-g grplist] [-G gidlist] [-n namelist]
[-o format] [-p proclist] [-R prmgrplist] [-s sidlist] [-t termlist]
[-u uidlist] [-U uidlist]
Here you can use that -x format too,
To do this,
set an environment variable as,
UNIX95=XPG4;export $UNIX95
Is it working out now with ps -efx there