I find it difficult to understand what appears in the ps command. To test my understanding, I created a script below the dummy
#!/bin/bash for i in {1..100000} do date -u date -u date -u done
while running this script, I opened a new terminal and re-executed
ps -eaf | grep date | grep -v grep
and I was able to process the output date.
I later changed the script mannequin, replacing date -u with echo "what is going on"
#!/bin/bash for i in {1..100000} do echo "What is going on" echo "What is going on" echo "What is going on" done
when running the updated layout script, I opened a new terminal and re-executed
ps -eaf | grep echo | grep -v grep
and the echo never showed up. Why is this? I suspect the reason is that the script is a bash script, maybe it uses the built-in echo, so it did not appear in the ps output. I'm right? What am I missing here?
source share