Question /help understanding vi logs ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question /help understanding vi logs ?
# 1  
Old 04-10-2013
Question /help understanding vi logs ?

Experts,
I have a question. Where are the vi logs are being stored.

For example: any command used within vi editor using :! ,(ex: :! pwd ex: :! ls -l ), so where the vi writes the command logs , dont see in .sh_history file so wondering.

Shell: /usr/bin/ksh

Thanks,
# 2  
Old 04-10-2013
Command history are stored in .viminfo file
This User Gave Thanks to Yoda For This Post:
# 3  
Old 04-11-2013
Yoda,
Thanks a lot, Does .viminfo applicable to hp-ux 11.23 server. I never seen a file .viminfo
Thanks.
# 4  
Old 04-11-2013
Quote:
Originally Posted by rveri
Does .viminfo applicable to hp-ux 11.23 server. I never seen a file .viminfo
No, this applicable for vim - Vi IMproved. I'm not sure if the vi in HP-UX supports command history.
This User Gave Thanks to Yoda For This Post:
# 5  
Old 04-11-2013
Use vi a little, go to your home directory, type ls -lart command, see if any kind of vi history file being generated.
This User Gave Thanks to hanson44 For This Post:
# 6  
Old 04-11-2013
Yoda, hanson. Thanks, but ls -llart no command history generated. So that is why my wonder if vi was capturing the command history somewhere in hp-ux ksh shell.
# 7  
Old 04-11-2013
If you want, you can post the results of ls -lart | tail.

Code:
$ ls -lart | tail -5
drwx------  2 xxx xxx     4096 Apr  7 15:51 .gnupg
drwx------  2 xxx xxx     4096 Apr 11 11:26 datafiles
-rw-rw-r--  1 xxx xxx   51851 Apr 11 11:26 .viminfo
drwxr-xr-x 32 xxx xxx     4096 Apr 11 11:26 .
-rw-rw-r--  1 xxx xxx  160586 Apr 11 14:50 .bash_history

If you do not see any files in the listing like .viminfo then no history being recorded.

Make sure you have set history=500 (or other value) set in your .exrc file or whatever vi startup file is used by your version of vi. It really helps to have history working, so it's worth the effort to figure out, I think.
Code:
set history=500


Last edited by hanson44; 04-11-2013 at 06:57 PM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

2. Shell Programming and Scripting

Need your help in understanding this

Hi, I found this in a script and I would like to know how this works Code is here: # var1=PART1_PART2 # var2=${var1##*_} # echo $var2 PART2 I'm wondering how ##* makes the Shell to understand to pick up the last value from the given. (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

3. AIX

Help in Understanding ISMP

Hi, Good day to everyone. This is my first time joining the community and wanted to say thanks in advance for all your help and assistance. First, I am not expert in AIX and UNIX but I do know a thing or two and I have a simple question regarding ISMP. We are using AIX 5.3 and a couple... (0 Replies)
Discussion started by: lgalang
0 Replies

4. UNIX for Dummies Questions & Answers

understanding {%/*}/

Hi Gurus: I am trying to understand the following line of code.I did enough of googling to understand but no luck.Please help me understand the follow chunk of code: X=$0 MOD=${X%/*}/env.ksh X is the current script from which I am trying to execute. Say if X=test.ksh $MOD is echoing :... (3 Replies)
Discussion started by: vemana
3 Replies

5. Windows & DOS: Issues & Discussions

Question; AWK to analyze Windows Server 2k3 logs

Hey, I am looking in to the possibility of trying to analyze Windows Server 2003 files by using the AWK filtering(programming) language, first off. Secondly I'm looking in to the possibility of implementing AWK (results/or the script itself) inside a "Microsoft Access 2007"-database. Some... (1 Reply)
Discussion started by: abciscool
1 Replies

6. Shell Programming and Scripting

need help understanding mv

I just started shell coding and I'm a bit confused on how 'mv' works can someone explain to me how it works and if i did this correctly. Thanks. echo "Enter Name of the first file:" read file1 #echo $file1 if ; then echo "Sorry, file does not exist." exit 1 ... (16 Replies)
Discussion started by: taiL
16 Replies

7. UNIX for Dummies Questions & Answers

Help Understanding Output and question about /dev/

Hi, I am having some problems understanding the info from the following output: Disk /dev/sda: 17849 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 *... (5 Replies)
Discussion started by: mojoman
5 Replies

8. Shell Programming and Scripting

Concatenate Logs - Perl Question

Hi All, I am fresh to perl and had been using shell scripting in my past experiences. In my part of perl program, i am trying to run a application command ccm stop, which should give some string output as the result. The output (error or sucess) has to be returned to an exisiting log file.... (4 Replies)
Discussion started by: ganga.dharan
4 Replies

9. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies
Login or Register to Ask a Question