Script A :
#!/bin/bash
cmdname=$1
process_num=$(ps -e | grep $cmdname | wc -l)
timestamp=$(date +%s)
echo -e "$timestamp\t process_num=$process_num"
Script B:
#!/bin/bash
cmdname=$1
process_num=$(ps -ef | grep $cmdname | wc -l)
timestamp=$(date +%s)
echo -e "$timestamp\t process_num=$process_num"
Suppose there is only one specified process on the system. The result of running script A is 1, but the result of running script B is 4. I don't know why?