[ale] Redirection using sudo...?

Pat Regan thehead at patshead.com
Tue Jun 13 15:14:11 EDT 2006


Michael B. Trausch wrote:
> Nope.  The following were tried, and failed.  :-/
>
> fd0man at fd0man-laptop:~$ sudo -i (echo 1 > /file)
> bash: syntax error near unexpected token `('
> fd0man at fd0man-laptop:~$ sudo -i echo 1 > /file
> bash: /file: Permission denied
> fd0man at fd0man-laptop:~$ sudo sh -c { echo 1 > /file }
> bash: /file: Permission denied
> fd0man at fd0man-laptop:~$
>   
This works for me:

sudo sh -c 'echo 1 > /root/file'


Pat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature




More information about the Ale mailing list