so, I happen to have a RISC machine, and gNAT doesn't exist. Therefore I am using the following trick
MachineA: ip 192.168.1.20, RISC workstation
MachineB: ip 192.168.1.24, i686 <-- gGNAT exists!
MachineA and MachineB share a folder-tree through the net (NFS, CIFS, whatever)
host_remote="192.168.1.24" # MachineB's IP
echo "step1"
ssh-keygen -t rsa
echo "step2"
if [ ! -f ~/.ssh/id_rsa.pub ]
then
echo "failure"
exit
fi
ssh $host_remote mkdir -p .ssh
echo "step3"
cat ~/.ssh/id_rsa.pub | ssh $host_remote 'cat >> ~/.ssh/authorized_keys'
(to be executed from the MachineA's console)
host_remote="192.168.1.24"
argc="$#" # how many arg from bash command line ?
app_args="" # where to store arguments from bash command line
args=("$@") # args[]={arg0..argC}
here="`pwd`"
argv="cd $here; source /etc/profile; "
for ((i=0;i<argc;i+=1))
do
argi="$i"
argv="$argv ${args[$i]} "
done
ssh $host_remote $argv
ans="$?"
if [ "$ans" == "0" ]
then
answ="success"
else
answ="failure"
fi
echo "$answ"
on MachineA, /usr/bin/myrexec (bash script)
Result, on MachineA
remote_ctrl # myrexec gnat list -v
GNATLS 4.3.5
Copyright (C) 1997-2007, Free Software Foundation, Inc.
Source Search Path:
<Current_Directory>
/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.3/adainclude/
/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.3/gcc/i686-pc-linux-gnu/4.3.5/adainclude/
Object Search Path:
<Current_Directory>
/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.3/adalib/
/usr/lib/gnat-gcc/i686-pc-linux-gnu/4.3/gcc/i686-pc-linux-gnu/4.3.5/adalib/
Project Search Path:
<Current_Directory>
/usr/lib/gnat/
failure
remote_ctrl # myrexec cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 1.80GHz
stepping : 7
cpu MHz : 1794.360
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pebs bts cid xtpr
bogomips : 3588.72
clflush size : 64
cache_alignment : 128
address sizes : 36 bits physical, 32 bits virtual
power management:
success
Ugly, simple, but it works