Urgent help needed for ksh shell setting

Today I logged as root on my HP-UX server and by mistake executed below command
# ksh -i vi

Then onwards for every root logging the ksh shell giving wired output to every command
e.g
# ls
k�
.brw_history
.brwpause
.brwtmp
: : :
1+~H4p+�+~K�
1+��
d
15k�
1d+~�Y�d:��h|�+~�Y4:�h|�+

And so on.....

As it is a main server I need to revert back the setting to normal..
Please help me in this regards...

Thanks

Sorry it was my mistake
Actually the ksh shell was responding without any junks on output for every command.

the command that I executed created some junk files under root's home directory, these files appears as follows
�k
�k
��D
�k
�k
k

when I tried to delete them I am getting an error that file does not exist.
These are ascci names, anyone knows how to delete these types of files

Thanks

By original root home directory you mean "/home/root" or "/root", not "/"

I suggest you create two new root directory backups

Then remove all files from the original root home directory

Create an empty directory and move all the files you want to that directory.

Then rename the original root directory to "root.bad", and rename the fresh version back to "root".

its a /rhome/root directory ... root's home directory

I can do the following

cp -r /rhome/root /rhome/root.bad
cd /rhome/root
rm *

then copy only required files/directories from /rhome/root.bad to /rhome/root
directory.

But does this affect any root user profile settings because when I will execute rm * in /rhome/root directory .. all files were get deleted including environment setting files and profile setting file.

anyway thanks... by doing this issue can be resolve

If you look at my suggestion, I was saying move the files and rename directories, hidden files would be maintained.

Guys

I do not really understand why you moving config files and why your mistake (i mean 'ksh -i vi') had impact on whole system.

Please provide us output from commands like:
set
env
stty

and content of files like:
/etc/profile
$HOME/.profile
$HOME/.env

Regards
Sebastian

ksh -i vi

     -i    If the -i flag is present or if the  shell  input  and
           output   are  attached  to  a  terminal  (as  told  by
           ioctl(2)), then this shell  is  interactive.  In  this
           case, TERM is ignored (so that kill 0 does not kill an
           interactive shell) and INTR is caught and ignored  (so
           that  wait  is  interruptible).  In all cases, QUIT is
           ignored by the shell.

So "ksh" will run through the binary program "vi" thinking it is a shell script. As this file is long and has lot's of characters in it, eventually there will be sections around a ">" character which it will try and run as a command with output redirected, as that data will be binary you will get the files names as previously mentioned.