newbie questions

Randy Pratt rpratt1950 at earthlink.net
Fri Apr 9 09:07:38 PDT 2004


On Fri, 9 Apr 2004 11:18:34 +0300 (EEST)
Radu MOLNAR <taipan at hawat.cc.ubbcluj.ro> wrote:

> I hope this is the right place to post this.Sorry if it isn't
> 
> Just some stupid newbie questions:
> 1) I have an alias made in my .profile alias vi='/usr/local/bin/vim' but
> the alias is not made when i log in X. If a log in console or using ssh
> from a remote host the alias is made but when i log in x it is not.
> Anybody know why? As shell i use bash.

Its definitely the right place to ask questions.  I can only comment
on the first question.

Its more of a question of how your shell is being invoked in your
window manager.  It sounds as if the window manager is invoking the
shell as a non-login shell.  You can test this by using
"xterm -ls" and see if your alias settings are being read.  This
causes the xterm to act as a login shell and bash will act
accordingly.

Take a look at man page for bash in the section "INVOCATION" for
a complete description of how bash behaves depending on whether
or not its a login or non-login shell.

There are several different ways to address it.  You could simply
duplicate your alias settings in a ~/.bashrc file which bash will
read when invoked in a non-login shell.  I personally don't like
having more than one place for any configuration.

It would probably be easier to change the way your window manager
invokes a shell.  I use xterms and blackbox so it was easy to
change the menu configuration from "xterm" to "xterm -ls".  If
you are using a different type of terminal window in XFree86, then
look in its documentation for a way to make it behave as a login.
If you're using some other terminal type, check its documentation
for similar things and change your window manager menus
accordingly.

HTH,

Randy


-- 


More information about the freebsd-questions mailing list