In Subject: [linux-users:100695] Re: [Summary] <Q> How to execute a script asanother user ?
SHIBATA Akira <shibata@xxxxxxxxxxxxxx> wrote:
>> shibata@pop:~$ sudo -u murooka echo $HOME
>> /home/shibata
sudo の挙動はともかくとして、
これでは $HOME が最初に展開されてしまい、実行されるのは
$ sudo -u murooka echo /home/shibata
になってしまいますね。
やるとしたら、
$ sudo -u murooka sh -c 'echo $HOME'
とかかなぁ。
--
Takeshi Kusune <kusune@xxxxxxxxxxxxxx>
Follow-Ups: References:
- Prev by Subject: [linux-users:100695] Re: [Summary] <Q> How to execute a script asanother user ?
- Next by Subject: [linux-users:100697] Re: [Summary] <Q> How to execute a script asanother user ?
- Previous by thread: [linux-users:100695] Re: [Summary] <Q> How to execute a script asanother user ?
- Next by thread: [linux-users:100697] Re: [Summary] <Q> How to execute a script asanother user ?
- Indexes:[Main][Thread]