Alessandro DE LAURENZIS writes: > Hello, > > I'm wondering how I could discard (not execute) a line after having > loaded it into vi (fc -e vi, or "v" for brevity in vi-mode). > > :wq, :q, :q! - all of them execute the line. > > I'm feeling really stupid...
The file initially contains the original line. So quitting without saving means the contents of the file, the original line, get executed. I just ddZZ when I activate the editor by accident. It would be nice to have "unchanged file" cancel the command. That's the behavior that VCSes have trained me to expect. But since bash behaves the same as ksh here, it might be difficult to justify changing it. -- Anthony J. Bentley