Hosting IP and sleep(t)

Hi folks,

Do you have any clue using Natural to implement the following :

(1) Obtain IP address of hosting machine

   I know there is system variable for getting host name and process ID, but can IP address of the hosting machine (the one the Natural session is running on) be obtainable easily by some Natural statements?Suppose it is Natural on Unix.

(2) Sleep(t) function

   Can a sleep(t) (where t is in seconds, for example) function be implemented with Natural, like the one in C language? I have thought of using timed looping but I doubt it can work precisely.
   Any idea? Suppose it is Natural on Unix.

Rgds,
Alex

Sleep 2 seconds:

callnat 'USR2027N' 2

You can use USR1052N or SHCMD to issue the command

ip -f inet addr | grep inet

and parse the IP out of the response.

Hi Wolfgang,

How can we collect the output from “SHCMD” back to Natural program ?

Thanks.

Tony,

you’ll have to redirect the command output to a file and read that in as a workfile in your Natural program.

Hi Wolfgang,

Thanks. That’s my original thinking.