Find the answer to your Linux question:
Results 1 to 5 of 5
All I am issuing a grep command to get some information, it works well. e.g. $ cat scan.c | grep main int main( void ) but by mistake my command ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Location
    India, At present in NTT, Japan as Partner Employee
    Posts
    15

    I face some problem in VI editor


    All

    I am issuing a grep command to get some information, it works well.
    e.g.

    $ cat scan.c | grep main
    int main( void )


    but by mistake my command is invalid and I issue like this
    $------------------------------------------------
    vi scan.c | grep main
    Vim: Warning: Output is not to a terminal

    int main( void )
    -------------------------------------------------

    now after that no key combination works to resume the Linux prompt '$'. And I need to close the existing xterm window and open a fresh one.

    Anybody have any idea what to do in this situation, help!!

  2. #2
    Just Joined!
    Join Date
    Apr 2005
    Location
    India, At present in NTT, Japan as Partner Employee
    Posts
    15
    I am not sure if I posted in correct format , no reply from any body,

  3. #3
    Just Joined!
    Join Date
    Mar 2005
    Location
    Northern Ireland
    Posts
    23
    Hi!

    When it happens try punching in a Control- Z command, this will suspend the vi process, and then kill the suspended job by using the kill command:

    Code:
    $
    $ vi scan.c | grep main
    Vim: Warning: Output is not to a terminal
    
    int main(void)
    --------> Crtl-Z<---------
    &#91;1&#93;+ Stopped          vi scan.c | grep main
    $
    $
    $ kill %1
    &#91;1&#93;+ Terminated      vi scan.c | grep main
    $
    $

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    To exit vi, type esc then :q

    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  6. #5
    Just Joined!
    Join Date
    Mar 2005
    Location
    Northern Ireland
    Posts
    23
    yeah; actaully you can get out of this by hiting the escape key and the type ":q" and the enter key. My first response was a little heavy handed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •