Welcome to WebProNews Breaking eBusiness and Search News
Advertise | Newsletter | Sitemap | News Feeds News Feed 
 WebProNews Search Part of the iEntry network iEntry inc. 

A Ps Problem With BBX

A.P. Lawrence
Expert Author
Published: 2006-02-13

WebProNews RSS Feed


Someone recently asked me about increasing command width for 'ps' on SCO Unix.

I thought I had the answer at Best of CUSM: width of command in ps, but it turns out that post was incorrect as a more recent newsgroup discussion explained. The SCO 'ps' is stuck at 80 characters.

The actual problem related to BBX. Apparently this gets run with very long command lines, but the part this person wanted to know about is at the end of the line - way out of the 80 character limit ps has here.

My immediate thought was to front-end BBX with a program that would capture the arguments and store them somewhere convenient. In Perl, that might look something like this:

#!/usr/bin/perl
$args=join '-',reverse @ARGV;
# just for more convenience
if ($pid = fork) {
    open(O,">pid.$pid");
    print O "$argsn";
    close O;
   waitpid($pid,0);
   unlink "pid.$pid";
} else {
   sleep 3600;
   # actually here you'd exec the real program,
   # this is just a concept script
   exit 0;
}


If you wanted to be even fancier and not use a file, you could fork off yet another program with more convenient arguments:

exec 'bbxmatcher', $pid, $args;

That bbxmatcher would do nothing but sleep; you'd kill it off when the real bbx returned. Then a "ps -e | grep bbx" would display just what you wanted - perhaps sometimes slightly out of order, but often not, and easily identifiable.

You'd end up being able to do something like this:

$ ./bbx args args args args args args args args SOMEPROG &

$ ps -e | grep bbx
  8970 p2 S+ 0:00.02 /usr/bin/perl ./bbxmatcher 8971 SOMEPROG-args-args-ar
  8971 p2 S+ 0:00.00 /usr/bin/perl ./bbx args args args args args args arg


The "bbxmatcher" tells us that the ending argument of pid 8971 was "SOMEPROG", and could tell us other things too, if we wanted.

For production use there's probably a bit more you'd want to do, but this is the basic concept. I don't know if this meets the original person's needs, but maybe it could be used in other situations. You could arrange the arguments however you like, add extra information in more convenient formats and so on. Could be helpful for someone..

*Originally published at APLawrence.com

Receive Our Daily Email of Breaking eBusiness News


About the Author:
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com

WebProNews RSS Feed

More Expert Articles Articles

Contact WebProNews
Advertisement





TOP NEWS

Targeted Information for Business
WebProNews is part of the iEntry network

Internet Business: Marketing: Small Business:
WebProNews MarketingNewz SmallBusinessNewz
WebProWorld AdvertisingDay PromoteNews
EcommNewz SalesNewz EntrepreneurNewz

Software: Search Engines: Web Design:
WebMasterFree Jayde B2B DesignNewz
NetworkingFiles SearchZA FlashNewz
SecurityConfig SearchNewz WebSiteNotes

Developer: IT Management: Security:
DevWebPro ITManagement SecurityProNews
DevNewz SysAdminNews SecurityConfig
TheDevWeb NetworkingFiles NetworkNewz

The iEntry Network consists of over 100 web publications reaching millions of Internet Professionals. Contact us to advertise.
eBUSINESS RESOURCES






 Advertise | Contact Us | Corporate | Newsletter | Sitemap | Submit an Article | News Feeds
 WebProNews is an iEntry, Inc. ® publication - $line) { echo $line ; } ?> All Rights Reserved
About WebProNews
WebProNews is the number one source for eBusiness News. Over 5 million eBusiness professionals read WebProNews and other iEntry business and tech publications.

WebProNews provides real-time coverage of internet business.

Free Email Newsletters:
WebProNews SearchNewz
WebProWorld DevWebPro
Marketing SecurityNews
Plus over 100 other newsletters!

Send me relevant info on products and services.


WebProWorld
Ten most recent posts.

NetworkingFiles
Featured Software

WebProNews in the News
View all recent mentions of WebProNews from around the world!

Recent Articles On ...
Google eBusiness
Yahoo Ask Jeeves
MSN Blogs
Search Engines Blogging
Affiliate Programs Marketing
eCommerce Advertising
eBay Sun Microsystems
AOL Adsense
Microsoft Adwords
Oracle IBM
Amazon Apple
SEM Mac
SEO iPod
Adsense XBox
PR Adobe



iEntry.com WebProWorld RSS Feed WebProWorld Contact WebProNews Print Version Email a friend Bookmark us