Urgent help needed for ksh shell setting


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Urgent help needed for ksh shell setting
# 1  
Old 11-04-2007
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

.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
# 2  
Old 11-04-2007
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
# 3  
Old 11-04-2007
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".
# 4  
Old 11-04-2007
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
# 5  
Old 11-04-2007
Quote:
Originally Posted by zing_foru
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.
If you look at my suggestion, I was saying move the files and rename directories, hidden files would be maintained.
# 6  
Old 11-04-2007
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
# 7  
Old 11-04-2007
ksh -i vi

Code:
     -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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. Shell Programming and Scripting

Urgent Help needed...

Hi I want to create a script which deleted files in the following folders older than 30 days. There are a particular version of files inside it to be deleted Folders : /files0/interfaces/ResponsysSavedList/BackInStock/EmailContent/backup... (3 Replies)
Discussion started by: Scudza
3 Replies

3. Shell Programming and Scripting

Urgent Help needed please

Hi, I have a small grepping problem in my script.I am having a file from which i need to make sure "#^A17" is the last updation (Next # can be ignored) before ################.The idea behind this is, if this file contains "A17" as the last updation, i need to do a particular activity. please... (7 Replies)
Discussion started by: Renjesh
7 Replies

4. Shell Programming and Scripting

Needed urgent help with shell script

Hi, Thanks for the reply to the previous posting.I need a shell script to the following.I am entirely new to the comapny and please help me with this. 1) Create the file with a timestamp i.e. nrt_readership.mmddyyyyhhmm 2) The processing job will look for files of the pattern... (0 Replies)
Discussion started by: pharishraja
0 Replies

5. Shell Programming and Scripting

Setting Variable in TCL to be understood by KSH Shell

Hi , I am having one TCL TK script , I am setting some variables in the GUI TK interface set DI 1 set MODELS_PATH /a/d/path but I want to make ksh shell understand the variables when I am running TK script I tried to do like this set a but it is not working ... (1 Reply)
Discussion started by: kshitij
1 Replies

6. Shell Programming and Scripting

Help needed - ksh shell scripting

Hi all, i m new to Unix shell scripting(ksh) i have a requirement, can anyone help me out in this.. spec: i need to move all the files landing in "X" directory to "Y" directory automatically everyday at a particular time.. (5 Replies)
Discussion started by: subbu
5 Replies

7. Shell Programming and Scripting

Script Needed Urgent in shell or PERL!!!!!!!!!!!!!!!!!!!!

My I/p FIle #%npr # { { collectionBeginTime_Date 19Jul2007 granularityPeriod 900 NODEID BSC19 RLC_Raw_Blocksize_CS2 2048 START_DATE 19Jul07 measTimeStamp_Date 20Jul2007 COLLECTION_INTERVAL_MINS 15 RLC_User_Blocksize_CS2 1024 ... (1 Reply)
Discussion started by: aajan
1 Replies

8. Solaris

Urgent help needed - shell script

Dear friends, I am trying to prepare a shell script which do the following task. Being a beginner in scripting I need a bit of help from you all for shell script which does the following job. 1.Check for existence of a file in a shared directory (at some remote location ) once in a day ... (3 Replies)
Discussion started by: aarora_98
3 Replies

9. Shell Programming and Scripting

help needed in shell scripting......urgent

Dear friends, please help me to solve following problem. I'm running a frontend application from which i'll be invoking the shell script with arguments as given below -driver -w -p "ABC XYZ" -S -ds con -dn "abc xyz" i am getting $1=-driver $2=-w $3=-p $4="ABC $5=XYZ" $6=-S $7=-ds... (3 Replies)
Discussion started by: swamymns
3 Replies
Login or Register to Ask a Question