Re: simple shell script question

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

 



On 08/10/2017 10:07 AM, bruce wrote:
> the test was to (1) replicate the results I get from the cmdline.
> and to then (2) be able to pass a input/var to then generate the pgrep
> count results
>
> the initial cmdline pgrep  -- pgrep -f 'bash' | wc -l
>  -- on the test box, this returns a "50" count
>
> in testing using php/bash -- i get a "51"
>
> #!/bin/bash -f
> #
> # ptest.sh
> #
>
> pgrep -f 'bash' | wc -l
>
> ------------------------------------
>
> on the test centos box, there is no pgrep -c << option.. haven't
> checked the fedora yet


You do realize that when you execute the shell script ptest.sh you create one more
process with "bash" in it?

So....

[egreshko@meimei ~]$ pgrep -f 'bash' | wc -l
4
[egreshko@meimei ~]$ ./pt.sh
5

is totally correct.


-- 
Fedora Users List - The place to go to speculate endlessly

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux