Shell script running error bash: JPS: command not found

Problem Description:

The script code is as follows:

#!/bin/bash
for i in node1 node2 node3
do
        echo "======== $i =========="
        ssh $i "jps" | grep -v Jps
done

The error message is as follows:

Solution:

Execute the following command: cat/etc/profile & gt& gt; ~/. Bashrc (each machine needs to execute)
the operation results are as follows:

Read More: