Script to ssh to different server and get some info

Hi Friends,

i am trying to write a script on server MACHINE1 to ssh to server MACHINE2 and fetch some information.

i am using the following command:

ChanCount=`ssh MACHINE2 "disp card all | grep Inserv | grep -v STATE | wc -l"`

The "disp" command works well on MACHINE2 but not working through this command and the output says "disp not found".

Please suggest the workaround.

Thanks,
Am

May be the "disp" command is not present or cannot be located in any of the directories listed in the PATH variable on the MACHINE2,if know under which directory its located use full path to the command.

Thanks
Nagarajan G

Thanks a lot Nagarajan. It Worked :slight_smile: