Results 1 to 2 of 2

Thread: Problem with ps command

  1. #1
    Join Date
    Aug 2009
    Beans
    126

    Problem with ps command

    I have a problem is executing few commands in my script.

    i will describe steps to reproduce it.

    1. set a variable PID's with 218 PIDS.

    Code:
    PIDs=4092092,4096180,4100336,4104412,4108416,4112630,4116536,4120794,4124888,4133020,4136982,4141290,4145288,4153372,4157504,4161578,4165774,4169780,4174010,4178052,4182200,4186186,4190404,4194394,4198608,4202634,4206610,4210920,4214846,4219066,4223048,4227172,4231384,4235398,4239472,4243680,4247742,4251860,4255948,4263978,4268234,4276348,4280326,4284512,4288720,4292638,4296842,4301048,4305032,4309134,4313134,4317194,4321364,4325390,4329570,4333790,4337914,4341958,4345918,4349952,4354112,4358386,4366380,4370656,4374734,4382764,4387042,4390942,4395242,4399184,4403258,4407388,4411552,4415514,4419678,4423708,4427808,4431940,4436146,4440222,4444322,4448316,4452456,4456658,4460642,4468932,4472900,4476974,4481040,4489308,4493474,4501526,4505744,4509710,4514046,4517952,4522104,4526254,4530340,4534422,4538552,4542646,4546714,4550684,4554956,4558870,4563048,4567266,4571348,4575426,4579542,4583480,4587588,4591830,4595920,4600038,4604116,4608234,4612340,4616390,4620302,4624480,4628498,4632598,4636900,4641006,4645118,4649214,4653290,4657272,4661468,4665466,4669694,4673554,4677662,4681802,4685826,4689960,4694044,4698132,4702268,4706306,4710478,4714506,4718600,4722710,4726800,4731056,4734986,4739136,4743196,4747272,4751438,4755468,4759594,4763866,4767784,4771900,4775996,4780212,4784174,4788272,4792372,4796638,4800586,4808764,4812940,4817102,4821016,4825340,4829416,4833514,4837402,4841588,4845746,4849856,4853878,4858092,4861998,4866072,4870162,4874414,4878486,4882564,4890658,4894940,4898900,4903158,4907144,4911310,4915286,4919386,4923398,4927720,4935716,4939948,4944008,4948016,4952196,4956298,4960462,4964584,4968462,4972750,4976730,4980764,4984986,4989016,4993274,4997122,5001470,5005398,5009532,5021850,5025866,5030078,5034194,5038146

    2. Now use command ps to check
    Code:
    ps -o pidvsz -p ${PIDs} |wc -l
    You can clearly see the difference in output. there are 218 pids but last command display only 128..

    any idea why?

    I am using AIX and ksh..
    Last edited by Blackbug; April 16th, 2012 at 09:28 AM.

  2. #2
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: Problem with ps command

    Are you certain that a process exists for all the PIDs in your list? If there is no process for some PIDs, ps wil not print anything about them.
    「明後日の夕方には帰ってるからね。」


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •