nazov perl programu pre top
Konference
konfer at mikulas.com
Mon Feb 6 08:30:28 CET 2012
Ahoj
v topu pri parametru -a nebo pri stisku klavesy "a" se ti zobrazi
detaily procesu
(tusim ze to je v top v BSDcku od verze 7.x)
-a Display command names derived from the argv[] vector,
rather
than real executable name. It's useful when you want
to watch
applications, that puts their status information there.
If the
real name differs from argv[0], it will be displayed in
paren-
thesis.
mik
Dne 5.2.2012 19:47, Michal Buchtik napsal(a):
> google me vyplivnul stranku kde bylo tohle:
>
> $0
> Contains the name of the file containing the perl script being
> executed. Assigning to $0 modifies the argument area that the ps(1)
> program sees. (Mnemonic: same as sh and ksh.)
>
> zkusil sem:
>
> #!/usr/bin/perl
> print `ps`;
> $0 = 'pokus-perl';
> print `ps`;
>
>
> PID TT STAT TIME COMMAND
> 3957 1 S+ 0:00,00 /usr/bin/perl ./test.pl (perl5.12.4)
> 3958 1 R+ 0:00,00 ps
> PID TT STAT TIME COMMAND
> 3957 1 S+ 0:00,01 pokus-perl (perl5.12.4)
> 3959 1 R+ 0:00,00 ps
>
> staci tak?
>
> Michal
>
> Dne 2012/02/05 19:09, Jozef Drahovsky napsal(a):
>> V tuto neskoru nedelnu hodinu mam jednu jednoduchu otazku:
>>
>> Ako definovat nazov programu v perle psutaneho zo shellu alebo cronu,
>> najlepsie definicia za #! aby v programe top bol identifikovatelny
>> a nesvietilo u vsetkych programov perlx.x.x ?
>>
>> ps
>> 15394 p0 S 0:00.01 /usr/bin/perl ./a (perl5.8.9)
>> 15594 p0 S 0:00.01 /usr/bin/perl ./b (perl5.8.9)
>> top
>> 14562 root 1 44 0 3148K 1236K select 7:36
>> 0.00% syslog-ng
>> 15594 root 1 8 0 4568K 1776K nanslp 0:00
>> 0.00% perl5.8.9
>> 15394 root 1 8 0 4568K 1776K nanslp 0:00
>> 0.00% perl5.8.9
>> 14767 root 1 44 0 23812K 12356K select 2:00
>> 0.00% httpd
>>
>>
>> Vie niekto poradit?
>> Jozef
More information about the Users-l
mailing list