Operating System - Linux
1829820 Members
2195 Online
109993 Solutions
New Discussion

vi filename- nothing happens

 
SOLVED
Go to solution
Maaz
Valued Contributor

vi filename- nothing happens

os: rhel 4
kernel: 2.6.9-22.EL

when I issue the following command nothing happens
#vi /path/to/filename
or
#vim /path/to/filename
that is simply "vi" or "vim" doesnt execute/run(gedit or cat are working fine), and also after "vi /etc/hosts", "ps ax" also doesnt show about "vi/vim".
Nothing speciall in /var/log/messages.

# rpm -q vim-enhanced
vim-enhanced-6.3.035-3
# rpm -q vim-minimal
vim-minimal-6.3.035-3

# rpm -ql vim-enhanced
/etc/profile.d/vim.csh
/etc/profile.d/vim.sh
/usr/bin/ex
/usr/bin/rvim
/usr/bin/vim
/usr/bin/vimdiff
/usr/bin/vimtutor
/usr/share/man/man1/rvim.1.gz
/usr/share/man/man1/vimdiff.1.gz
/usr/share/man/man1/vimtutor.1.gz

# rpm -ql vim-minimal
/bin/ex
/bin/rvi
/bin/rview
/bin/vi
/bin/view
/etc/vimrc

11 REPLIES 11
Ivan Ferreira
Honored Contributor

Re: vi filename- nothing happens

Can you specify the full path to the command, for example:

/bin/vi /etc/hosts

or

/usr/bin/vim /etc/hosts


Check aliases:

alias vi
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: vi filename- nothing happens

Thanks Ivan for reply.
>Can you specify the full path to the command, for example:
>/usr/bin/vim /etc/hosts

#/usr/bin/vim /etc/hosts
nothing happens ;(


>Check aliases:
>alias vi
here is the output of "alias"
#alias vi
alias vi='vim'

Ivan Krastev
Honored Contributor

Re: vi filename- nothing happens

Try to check packages and files - http://www.rpm.org/max-rpm/ch-rpm-checksig.html

Also try to reinstall package.

Do you have same error with other editor ?


regards,
ivan
Ivan Ferreira
Honored Contributor

Re: vi filename- nothing happens

what is the output of

rpm -V vim-enhanced
rpm -V vim-minimal
ls -la /usr/bin/vim
ls -la /bin/vi

echo $PATH
whereis vi
which vi

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
George Liu_4
Trusted Contributor

Re: vi filename- nothing happens

What do yo mean "nothing happened?" Is it quit or waiting for input?


try just /usr/bin/vim
without any arguments to see what happens
Alexander Chuzhoy
Honored Contributor

Re: vi filename- nothing happens

Hi,
also try `alias |grep vi`

By nothing happens- you mean that you get the prompt back?
Maaz
Valued Contributor

Re: vi filename- nothing happens

Thanks All for the help/reply... and sory for replying late.

Dear Ivan....
# rpm -V vim-minimal ;[nothing happens... simply got the prompt back]
# rpm -V vim-enhanced
S.5....T. /usr/bin/vim
# ls -la /usr/bin/vim
-rwxr-xr-x 1 root root 0 Nov 26 22:05 /usr/bin/vim
# ls -la /bin/vi
-rwxr-xr-x 1 root root 468864 Dec 5 2004 /bin/vi
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
# whereis vi
vi: /bin/vi /usr/share/man/man1p/vi.1p.gz /usr/share/man/man1/vi.1.gz
# which vi
alias vi='vim'
/usr/bin/vim

Dear George Liu and Alexander
# /usr/bin/vim ;[nothing happens... simply got the prompt back.. and this is the actual prblm]
# alias |grep vi
alias vi='vim'

"nothing happened" means "quit" or "got the prompt back" and/or even "no error" and also nothing relevant/special in /var/log/messages

Regards
Maaz
Maaz
Valued Contributor

Re: vi filename- nothing happens

Dear Ivan Krastev

>Also try to reinstall package.
first I want to resolve/troubleshoot this issue.. this is the last option.

>Do you have same error with other editor ?
no
Jeff_Traigle
Honored Contributor

Re: vi filename- nothing happens

Looks to me like your vim installation isn't complete (or vim got truncated by someone or something on Nov. 26). Note /bin/vim is zero length in your ls output. I bet if you try "/bin/vi testfile" it might actually start the editor since that binary appears to have a size.
--
Jeff Traigle
Ivan Ferreira
Honored Contributor
Solution

Re: vi filename- nothing happens

Reinstall vim, because:

# rpm -V vim-enhanced
S.5....T. /usr/bin/vim

Indicates that the vim command was modified since the installation, in this case the Size, the MD5 checksum and the modification time of the file where modified (see man rpm)

# ls -la /usr/bin/vim
-rwxr-xr-x 1 root root 0 Nov 26 22:05 /usr/bin/vim

Indicates that the program has 0 bytes and will never work.

To reinstall use:

rpm -ivh vim-enhanced-version.rpm --force
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: vi filename- nothing happens

Thanks all(esp Ivan Ferriera) for help/support.

for me its quite strange...why/how vim became corrupted, because I am the only person who can access this rhel box, and this box is never connected to the internet, virus/worms are not possible.
At the end I hardly accept(since no one can access this machine) that I myself hav done some mistake(edit the vim.. somehow)

Anyhow thanks All
Regards
Maaz