ksh script that echo " please insert your name " and store the output to a login.log file.

Hello All
Nice to meet you all here in this forum,
it's my 1rst time here
i'm asking about a little issue that i face
i added a ksh script that echo " please insert your name " and store the output to a login.log file.
the script is working fine with normal telnet
but Xstart is not working anymore with this user account.
can any one tell me how to export this echo to Xstart ????
Best Regards

---------- Post updated at 08:15 AM ---------- Previous update was at 05:42 AM ----------

echo "Please insert your User Name "
read x
echo $x `who am i` " Success " >> /login.log

this is the script, and i added it to .profile, it is working fine with telnet but it's not working with xterm or xbrowser
any advice ????

To answer your question we need to know a little more:
What is the "start not working"?
In other words, you modified a .profile but we do not know of what box... (local, distant) and how you connect (Is local a pc using X server software or a linux...)

i have an IBM P5 server and users connect to this server remotely using telnet or Xstart.
i modified the .profile of the user on AIX with a script named login.sh
this script contain the following lines
echo "Please insert your User Name "
read x
echo $x `who am i` " Success " >> /login.log
it works normally with telnet
but it is not working with Xstart
i think because of display or something like that

and one thing sure I wouldnt have used x for a variable name...

---------- Post updated at 14:45 ---------- Previous update was at 14:42 ----------

So you modified the .profile on that AIX box, but what do you mean by:

the .profile of the user account on the AIX P5
/home/user/.profile

but that user when he connects is not physically on that box ,we agree? Therefore my question: Is that user using a PC with X emulation (Xserver software such as hummingbird, reflectionX etc...) in wich case I understand you startx as XDMCP session etc...
These software need to be able to send back the IP seen from your P5 then it opens a new session (the Xterminal you get displayed...) and so its also a new shell...
If you can echo, set variable etc... the fact that you put a read in blocks the good working of the .profile...

yes the user is using Xserver sofware ( xmanager )

But I see what you are trying to do... Remove what you have done and look here:

Here is a way to do so, I put this in /etc/profile

LOG='who am i'
ME=$LOGNAME
    (date;echo $ME;$LOG)|xargs >>/login.log

And like that whoever connects to the box is logged with timestamp...

All the best

thank you