Re: /proc/${PID}/cmdline parsing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Joel Fernandes <agnel.joel@xxxxxxxxx> :
>> If I launch a 
>>  $ watch find / -type f -name 'toto'
>> (it's a useless command just for the example)
>> and then I get the PID of this.
>PID of what? watch or find?

PID of "watch"

>> When I 
>>  $ cat /proc/${PID}/cmdline
>>  watchfind/-typef-nametoto
>> Yes, it's the command line, but I would like to parse it, in order to
>> display the launched executable + its arguments.
>> How to parse it?
>Could you be a bit more clear with your question?

I want to split "watchfind/-typef-nametoto" (the content
of /proc/${PID}/cmdline) to get "watch find / -type f -name toto" (the
command I issued above)

But I cannot figure out how to split it.
Would you know another place in the system I should look at?

-- 
       Architecte Informatique chez Blueline/Gulfsat:
    Administration Systeme, Recherche & Developpement
                                     +261 3456 000 19
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs


[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux