vi question: does :q! override saves using :w ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting vi question: does :q! override saves using :w ?
# 1  
Old 06-15-2011
vi question: does :q! override saves using :w ?

story is i accidentally saved when i intended to quit. the 'w' and 'q' is button too close, so i pressed the wrong one. now, i saved changes that i don't remember all over this lengthy script.
# 2  
Old 06-15-2011
I think what you are asking is this: If I enter :q! will that revert the file to the state before I started editing it.

The answer to that question is no. It will quit the edit session and discard any changes since the last :w command was issued. If no changes were written since the beginning, then the effect is to leave the original file unchanged, but as you've written out a set of changes, the revert is only to that state.
This User Gave Thanks to agama For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to override Classpath?

Hi, When I login to my HP-UX and fire the "set" command I see that the weblogic 9.2 classpath is already set. However, I wish to override the classpath to weblogic version 10.3 I have a script call setWLSEnv.sh that has the desired classpath. Thus, in my unix script i write .... (6 Replies)
Discussion started by: mohtashims
6 Replies

2. Shell Programming and Scripting

SQL/Plus in a coprocess example. Also saves query results into shell variables

While assisting a forum member, I recommended running SQL/Plus in a coprocess (to make database connections and run a test script) for the duration of his script rather than starting/stopping it once for every row in a file he was processing. I recalled I made a coprocess example for folks at... (2 Replies)
Discussion started by: gary_w
2 Replies

3. Shell Programming and Scripting

Replacing strings in a log file and saves as a new csv

Hello Im new here.I need to replace strings and change it into csv format, or at least saves the file as csv if that would work :p. Heres an example of my scenario 1) I have a log file, named abc.log, and its like a txt based file anyway, and the content looks like this ... (2 Replies)
Discussion started by: tententen
2 Replies

4. Programming

How to override my profile

I would like to override the default profile which is loaded when the system starts or When I run a program so that profile should get loaded in the settings. Is there any system call to do so. . (0 Replies)
Discussion started by: mobile01
0 Replies

5. Programming

override the function in C

hi , greetings , I have one doubt reg the C functions . I have a program sample.c , in which i have function name scanf , which reads a a variable and prints the variable inside the function . this scanf is nothing to do with C library function scanf , but i would like to use only user... (1 Reply)
Discussion started by: naren_chella
1 Replies

6. IP Networking

Override

Hi My computer of late started misbehaving. Whenever I switch it on It say Override and then it takes long to boot. Surprising is that it opens excel automatic. What could be that? (1 Reply)
Discussion started by: Mulo
1 Replies

7. UNIX for Dummies Questions & Answers

Override protection.....

I am having this problem......when I run this script: print -n "Enter file name to be deleted: " read answer if then rm $name else echo "No such file with the name: $name exists" fi I was trying to test my script for errors, and basically when the user had files with the rights: 400,... (1 Reply)
Discussion started by: Makaveli.2003
1 Replies
Login or Register to Ask a Question