# Hosting IP and sleep(t)

**URL:** <https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [August 13, 2007, 11:42am UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206 "2007-08-13T11:42:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Chung](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@Alex\_Chung](https://techcommunity.softwareag.com/u/Alex_Chung)\
**Post date:** [August 13, 2007, 11:42am UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/1 "2007-08-13T11:42:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [August 13, 2007, 12:38pm UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/2 "2007-08-13T12:38:21Z")

</div>

> [@](#):
>
> Can a sleep(t) (where t is in seconds, for example)

Sleep 2 seconds:

```auto
callnat 'USR2027N' 2
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [August 13, 2007, 1:05pm UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/3 "2007-08-13T13:05:42Z")

</div>

You can use USR1052N or SHCMD to issue the command

```auto
ip -f inet addr | grep inet
```

and parse the IP out of the response.

---

<div class="post-metadata">

**Author:** ![Tony\_Y](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tony_y/32/121_2.png) [@Tony\_Y](https://techcommunity.softwareag.com/u/Tony_Y)\
**Post date:** [August 20, 2007, 9:59pm UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/4 "2007-08-20T21:59:21Z")

</div>

Hi Wolfgang,

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

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [August 20, 2007, 10:12pm UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/5 "2007-08-20T22:12:48Z")

</div>

Tony,

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

---

<div class="post-metadata">

**Author:** ![Tony\_Y](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tony_y/32/121_2.png) [@Tony\_Y](https://techcommunity.softwareag.com/u/Tony_Y)\
**Post date:** [August 21, 2007, 9:04pm UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/6 "2007-08-21T21:04:12Z")

</div>

Hi Wolfgang,

Thanks. That’s my original thinking.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:48pm UTC](https://techcommunity.softwareag.com/t/hosting-ip-and-sleep-t/75206/7 "2021-04-02T14:48:38Z")

</div>


