cron problem for getting the time

Grateful if anyone could answer my question

The script called time.sh try to retrive the server time on another server and write into a files named "abc.123" as show below.

time.sh

#!/bin/sh
telnet 10.122.38.109 13 | tail -1 >/tmp/abc.123

The result when run on console or any active prompt is expected
Tue Jul 31 16:15:57 2007

However, when the script set as a cron, there is no time is being logged
Escape character is '^]'.

Could someone please give me a hand on this issue. Thank

regards,
darkrainbow

can you try with tail -3

give the entire path of telnet in the script that u r putting in the cron....
i mean do a 'which telnet' and find out the path of telnet. Give this in ur script...

It did not log down any time information at all

more abc.123

Trying 10.122.38.109...
Connected to 10.122.38.109.
Escape character is '^]'.

The script has been amended
#!/bin/sh
which telnet >/tmp/abc.123
telnet 10.122.38.109 13 | tail -3 >>/tmp/abc.123

and here is the result

/usr/bin/telnet
Trying 10.122.38.109...
Connected to 10.122.38.109.
Escape character is '^]'.