Welcome to the VirtuQ Forums.
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2011
    Location
    Bangalore
    Posts
    13

    regarding ps command behavior after script command

    Hi,

    Why process ID's are changed for shell, while running the ps command after running script command?

    Regards
    anon 10055

  2. #2
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    Anon10055,

    I am not sure I follow the question. PIDs for the ps command will keep on changing because a new process is spawned everytime you type ps and press enter. For the spawned off shell, they will remain the same. Please clarify, otherwise this thread is up for speedy deletion.

    Thanks,

    Anup

  3. #3
    Member
    Join Date
    Oct 2011
    Location
    Bangalore
    Posts
    13
    Hi,

    Yes..PID will be changing, here i am running ps command then script command and then ps again, in this case PID of bash has changed, In normal case it doesn't...why?


    Regards
    anon 10055

  4. #4
    VirtuQ™ Moderator
    Join Date
    Jul 2011
    Location
    Bangalore, India
    Posts
    1,044
    Blog Entries
    2
    I can give the answer, but, it would be interesting if you figure this out yourself. Do a pstree from the script instead of ps, you will notice two shells. PID for only one of them will be changing.

    Cheers,

    Anup


 

Posting Permissions

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