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