This one thing (being due to delay) also sees:
$ ps ax | grep novalidname
Here it also shows. (on Ubuntu does for me. (under bash)
Another thing is that related to / bin / sh?
Most Linux / bin / sh distributions have a soft link to the default shell, which is usually actually bash, but can be any other shell.
The temporary difference causing grep / pgrep to display can be entered by looking for the location of the soft link (hm, odd) or some other shell related to / bin / sh, which runs slightly different than bash, which results in the delay required for the process to display in pgrep.
In addition, bash will first try to load the source ~ / .bashrc and load its history, and / bin / sh will do whatever it takes. In .bashrc, pgrep can be defined as an alias in another way, which can also affect the difference.
To see where / bin / sh points to:
$ readlink -e /bin/sh
Or just run sh to see what will be displayed .: D
source share