1 |
Mick wrote: |
2 |
|
3 |
> On Monday 02 May 2011 12:52:12 Alex Schuster wrote: |
4 |
> > Mick writes: |
5 |
|
6 |
> > > Thanks. Not sure if there is a difference between an env.d variable |
7 |
> > > and a profile.d variable. |
8 |
> > |
9 |
> > None you will notice, both /etc/profile.env and scripts in |
10 |
> > /etc/profile.d/ are sourced in /etc/profile. profile.env contains all |
11 |
> > stuff in /etc/env.d/ after you ran env-update. |
12 |
> |
13 |
> Hmm ... I initially set up a file in /etc/profile.d/99editor with |
14 |
> |
15 |
> EDITOR="/usr/bin/vim" |
16 |
> |
17 |
> in it. Upon reboot I still got: |
18 |
> |
19 |
> echo $EDITOR |
20 |
> /bin/nano |
21 |
|
22 |
I looked into /etc/profile, and right at the bottom it does this: |
23 |
|
24 |
for sh in /etc/profile.d/*.sh ; do |
25 |
[ -r "$sh" ] && . "$sh" |
26 |
done |
27 |
unset sh |
28 |
|
29 |
So the file needs to have the .sh suffix. |
30 |
|
31 |
> So, I thought of moving it into /etc/env.d/97editor. Upon another reboot |
32 |
> (troubleshooting network problems) I again found out that nano is my |
33 |
> default editor ... neither locations seem to being read at boot time? |
34 |
> |
35 |
> Running env-update && source /etc/profile did not make any difference. |
36 |
> |
37 |
> Is the number prefix important? Does it have to be 99editor? If so, how |
38 |
> does one discover the correct number for each variable? |
39 |
|
40 |
Maybe the 99 is what eselect wants the number to be. If you manage files in |
41 |
there yourself, I think it should not matter. The result of env-update in |
42 |
/etc/profile.env is sorted alphabetically, so the order of file in |
43 |
/etc/env.d should not matter, I think. |
44 |
|
45 |
|
46 |
> > I do not manually change things in env.d, but with 'eselect editor set |
47 |
> > <n>' you can create a file /etc/env.d/99editor which will set the |
48 |
> > EDITOR variable to the editor you gave eselect as argument. Enter |
49 |
> > eselect editor list to se what's available, or just give the editor |
50 |
> > path as argument to eselect. |
51 |
> |
52 |
> # eselect editor list |
53 |
> Available targets for the EDITOR variable: |
54 |
> [1] /bin/nano |
55 |
> [2] /usr/bin/ex |
56 |
> [3] /usr/bin/vi |
57 |
> [ ] (free form) |
58 |
> |
59 |
> What does the "[ ] (free form)" above refer to? |
60 |
|
61 |
That you can specify any other binary as editor if you like, with "eselect |
62 |
editor set /path/to/my/editor". |
63 |
|
64 |
> > > I've added mine to /etc/profile.d for now. I'll |
65 |
> > > see what gives when I reboot. |
66 |
> > |
67 |
> > A relogin would be enough. Or '. /etc/profile' in the shell, this is |
68 |
> > what eselects suggests to do. Or bash -l, or xterm -ls. |
69 |
> |
70 |
> Yep, setting the EDITOR using eselect works fine. |
71 |
|
72 |
Hooray! |
73 |
|
74 |
Wonko |