LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-12-2004, 05:14 AM   #1
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Rep: Reputation: 30
When referencing a command, how far in depth can the symbolic link be followed?


Code:
david:/# which vi       
/usr/bin/vi

david:/# ls -l /usr/bin/vi
lrwxrwxrwx    1 root     root           20 Apr  3 11:49 /usr/bin/vi -> /etc/alternatives/vi

david:/# ls -l /etc/alternatives/vi
lrwxrwxrwx    1 root     root           13 Apr 13 02:08 /etc/alternatives/vi -> /usr/bin/gvim

david:/# ls -l /usr/bin/gvim
lrwxrwxrwx    1 root     root            3 Apr 10 22:24 /usr/bin/gvim -> vim
In short, /usr/bin/vi ---> /etc/alternatives/vi ---> /usr/bin/gvim ---> /usr/bin/vim.

When I do a vi <filename>, vim is launched instead of gvim.
However, when I do a /usr/bin/gvim (which is linked to vim), gvim is launched. Is it cos there are too many symbolic links between /usr/bin/vi and /usr/bin/gvim?

Please enlighten me... this alternatives system is mind blowing

Thanks !
 
Old 04-12-2004, 05:26 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I don't have gvim installed on my computer. You didn't say how you launched gvim. From the console or KDE menu. A program may look at $0 to find you how it was called, and change it's behaviour appropriately. When launching a program graphically, there are parameters which may be included when launched.
 
Old 04-12-2004, 06:09 AM   #3
davidas
Member
 
Registered: Mar 2004
Distribution: Debian 'Sarge'
Posts: 168

Original Poster
Rep: Reputation: 30
From commandline,

/usr/bin/vi will launch vim.
/usr/bin/gvim will launch gwim.

However, as stated in my first post, /usr/bin/vi has been symbolically linked to /usr/bin/gvim ultimately via /usr/bin/vi ---> /etc/alternatives/vi ---> /usr/bin/gvim ---> /usr/bin/vim.

The manner which is used to call vim will determine if vim or vim -g (GUI version) will be launched. If gvim is used to call vim, then vim -g version (=gvim) will be launched.

Thanks

Quote:
Originally posted by jschiwal
I don't have gvim installed on my computer. You didn't say how you launched gvim. From the console or KDE menu. A program may look at $0 to find you how it was called, and change it's behaviour appropriately. When launching a program graphically, there are parameters which may be included when launched.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Symbolic link? jasone Linux - Newbie 4 05-06-2005 07:55 AM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 10:01 AM
symbolic link jsetter Linux - Newbie 4 11-22-2004 07:18 AM
ls -laL command for Symbolic Link jlaruffa Linux - Newbie 7 06-22-2003 12:37 PM
Linux tar command with symbolic link bug? LinuxQuest01 Linux - General 3 02-07-2003 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration