On 26/03/2018 11:46, Richard Kettlewell wrote:
> "A. Dumas" writes:
>> On 26/03/2018 10:13, Richard Kettlewell wrote:
>>> "A. Dumas" writes:
>>>> Yeah and you can't pipe to sudo.
>>>
>>> Yes you can...
>>
>> I'm stupid and was only thinking of output redirection to a file
>> (which you can make work by '|sudo tee' so that's a counter example
>> already...)
>
> Redirection of sudo’s output to a file works fine too. Possibly the
> thing that is confusing you is that output redirection is done by the
> calling process, which when invoking sudo usually means it is done as a
> mortal user.
No I am no longer confused, that is exactly what I meant & what I said:
"sudo echo sometext >> /etc/notmyfile" won't work but "echo sometext |
sudo tee -a /etc/notmyfile" will, for the reason you spelled out.
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|