[sudo-users] sudo problems with internal shell command

Wesley Schwengle wesley.schwengle at is.online.nl
Thu Feb 11 05:14:35 EST 2010


On 10.02.10 14:14 Aaron Lewis wrote:

> Well , i got some problems with such command:
>
> sudo echo disable > /proc/acpi/ibm/bluetooth
>
> Permission is denied.
> I think it's because 'echo' is run in shell , as normal user  , then it
> fails to run.
>
> This works fine:
> sudo su - -c 'echo disable > /proc/acpi/ibm/bluetooth'
>
> Anyway to solve it ?

You can also do it like this:

echo "blaat" | sudo tee /tmp/blaat

or to append to a file:

echo "blaat-append" | sudo tee -a /tmp/blaat

Hope this helps.

Cheers,
Wesley

-- 
Online Broadband BV, http://www.online.nl, http://www.euronet.nl
Wesley Schwengle, System Administrator, IT Operations (Database/Application Management)
Muiderstraat 1, PO BOX 10241, 1001 EE Amsterdam, T: +31 20 5355555, F: +31 20 5355749



More information about the sudo-users mailing list