1 |
Hi, Meino |
2 |
|
3 |
I'd make a script, sudo_with_rehash: |
4 |
|
5 |
sudo "$@" |
6 |
rehash |
7 |
|
8 |
and add to whatever is the equivalent of .bashrc for zsh: |
9 |
|
10 |
alias sudo="source sudo_with_rehash" |
11 |
|
12 |
Would that work for you? |
13 |
|
14 |
Best, |
15 |
Anton |
16 |
|
17 |
On Wed, Oct 31, 2018 at 4:49 AM <tuxic@××××××.de> wrote: |
18 |
|
19 |
> Hi, |
20 |
> |
21 |
> often I have this scenario: |
22 |
> I miss an application/script, a setting or something like that. |
23 |
> To apply the modifikation I becom root from the shell I was using as user. |
24 |
> I modificate/install or whatever change is needed... |
25 |
> I CTRL-D back to my user shell. |
26 |
> |
27 |
> Now I have to do a "rehash" (I am using zsh) to make the change |
28 |
> visible/accessible. Sometimes I forget that. |
29 |
> |
30 |
> So...is it possible to auto-execute a "rehash" or whatever is needed, |
31 |
> when the user is comeing back from his alternate life as root? |
32 |
> |
33 |
> Thanks a lot for any help in advance! |
34 |
> Cheers! |
35 |
> Meino |
36 |
> |
37 |
> |
38 |
> |
39 |
> |