From: "Lewis G Rosenthal" Received: from [192.168.100.201] (account lgrosenthal@2rosenthals.com HELO [192.168.100.23]) by 2rosenthals.com (CommuniGate Pro SMTP 5.4.10) with ESMTPSA id 1422767 for ecs-isp@2rosenthals.com; Mon, 14 Dec 2020 15:05:57 -0500 Subject: Re: [eCS-ISP] CLI util to show if a task has a number of instances in memory To: eCS ISP Mailing List References: Organization: Rosenthal & Rosenthal, LLC Message-ID: <5FD7C5A2.40402@2rosenthals.com> Date: Mon, 14 Dec 2020 15:05:54 -0500 User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:38.0) Gecko/20100101 Firefox/38.0 SeaMonkey/2.35 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi... On 12/14/20 02:35 pm, Steven Levine wrote: > In , on 12/14/20 > at 11:50 AM, "Lewis G Rosenthal" said: > > Hi guys, > >> [c:\]pstat | grep -ic httpd >> 15 > Or use continue to use go: > > [d:\tmp]go | grep RSYNC > 16559 138 01F VIO 2 0200 0:00:26.34 RSYNC.EXE > 16560 16559 01F VIO 2 0200 0:00:24.00 RSYNC.EXE > 16561 16560 01F VIO 1 0200 0:00:00.09 RSYNC.EXE > > If you really just want the count, with 4OS2 it's > > [d:\tmp]echo %@execstr[go | grep RSYNC | wc -l] > 3 > No need to pipe grep through wc. the -c option does this automatically, but the point is well taken. > To use the count in your script, it's > > set CNT=%@execstr[go | grep RSYNC | wc -l] > >> I try to find one-liners to do what I can, and then resort to perl or >> REXX if necessary. Use what's comfortable. > No perl needed here. :-) > :-) > FWIW, if the script is already REXX, there's Sys2QueryProcessList from > Alex's rxutilex.dll. > Good point. I forgot about that function. -- Lewis ------------------------------------------------------------- Lewis G Rosenthal, CNA, CLP, CLE, CWTS, EA Rosenthal & Rosenthal, LLC www.2rosenthals.com visit my IT blog www.2rosenthals.net/wordpress -------------------------------------------------------------