Without config files, with different ports, different keys and different users:
jump host port: 2244, target host port: 2266 (ports are just examples). If standard port (22) is used, then -p/-P options can be omitted.
OUTPUT=$(ssh -o ProxyCommand="ssh -W %h:%p $JUMPHOST_USER@$JUMPHOST_IP -p 2244 -i jumphost_key_file" -oStrictHostKeyChecking=accept-new $TARGETHOST_USER@$TARGETHOST_IP -p 2266 -i targethost_key_file 'command')
echo $OUTPUT
-oStrictHostKeyChecking option is for automatically accepting ECDSA key. If this is a security issue for you, you should take out this option, but then first time need to acknowledge manually.
Also don't forget to allow agentforwarding on jump host in sshd_config.
It may also be necessary to allow TCPForwarding as well on jump host in sshd_config, and maybe in /etc/sysctl.conf need to uncomment/enable net.ipv4.ip_forward = 1.
if you want to run a local script on the target host:
OUTPUT=$(ssh -o ProxyCommand="ssh -W %h:%p $JUMPHOST_USER@$JUMPHOST_IP -p 2244 -i jumphost_key_file" $TARGETHOST_USER@$TARGETHOST_IP -p 2266 -i targethost_key_file 'bash -c' <local_bash_script.sh)
echo $OUTPUT
scp can also be used like this:
scp -o ProxyCommand="ssh -W %h:%p $JUMPHOST_USER@$JUMPHOST_IP -p 2244 -i jumphost_key_file" -i targethost_key_file -P 2266 local_file_to_copy.txt $TARGETHOST_USER@$TARGETHOST_IP:/tmp/new_file_name.txt
note capital P for port in scp command, but not in ssh! omit new_file_name.txt if you don't want to change the file name. I have this running on debian 10
Hope this helps if you don't want to maintain config files.