Since it’s not clear what you’re trying to do:
If you expect the following output:
yypasswd
then do
ps -ef | grep yypasswd | awk '{print $8}'
if you want the following output:
testacc 25124194 2512312620 0 08:00:53 pts/0 0:00
then do
ps -ef | grep yypasswd | awk '{print $1, $2, $3, $4, $5, $6 ,$7}'
hope that helps.
1
solved how to extract word from ps -aux