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...
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
-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.