howto run remotely call function from within script

Hi

I have the following script :

#!/bin/ksh
#################### Function macAddressFinder ########################
macAddressFinder()
{
  `ifconfig -a > ipInterfaces`
   `cat ipInterfaces`
}
#######################################################################



#
#
  
print -n "Server name is: "
read ServerName
     
     ssh $LOGNAME@$ServerName "$(macAddressFinder)"

exit

When I execute this script I receive output from function macAddressFinder only from the machine where I executed this script. It doesn't give me back data from remote machine.

Hello~ :wink:

I think you should use only "Command" with ssh.

So if you want to call function, it is better to make a script.
For example...

1) yourcommand.sh
---> ssh $LOGNAME@$ServerName "/tmp/function.sh"

2) /tmp/function.sh
---> ifconfig -a > ifInterfaces
---> cat ifInterfaces

.... It works well. Thank you~. :wink:

Yes this solution I allready figured out. I was wondering is there a way to do it without file with function definition ?
Maybe through some interface like in object oriented programming ?