[sudo-users] sudo problems with internal shell command

Battersby-Cornmell, Robin Alasdair Robin.Battersby-Cornmell at uisl.unisys.com
Thu Feb 11 04:53:44 EST 2010

You will find that the first statement run the echo as super user, but it is the normal user that is catching the output and re-directing to a file.  In the second example, this is all contained by the super user process and therefore the write to file would work.

You could script it and sudo call the script.

Unisys, Liverpool


-----Original Message-----
From: Aaron Lewis [mailto:aaron.lewis1989 at gmail.com] 
Sent: 10 February 2010 13:15
To: sudo-users at sudo.ws
Subject: [sudo-users] sudo problems with internal shell command

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 ?

Best Regards,
Aaron Lewis
RedHat Certificated Engineer


This email is sent in confidence for the addressee only.

Unauthorised recipients must preserve this confidentiality and should please advise the sender immediately by returning the original email to us without reading it, taking a copy or disclosing it to anyone else. Please also destroy and delete the email from your computer.

We have taken reasonable precautions to ensure that no viruses are transmitted to any third party. Unisys Insurance Services Limited does not accept any responsibility for any loss or damage resulting directly or indirectly from the use of this email or its contents.

Unisys Insurance Services Limited is authorised and regulated by the Financial Services Authority, is a member of the UNISYS group of companies and provides outsourcing services to the Financial Services Industry

Unisys Insurance Services Limited Registered in England No. 4087012
Registered Office: Bakers Court, Bakers Road, Uxbridge, UB8 1RG

More information about the sudo-users mailing list