From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.77) (envelope-from ) id 1Sl37N-0006Fa-JP for garchives@archives.gentoo.org; Sat, 30 Jun 2012 19:14:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC01321C017; Sat, 30 Jun 2012 19:03:24 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by pigeon.gentoo.org (Postfix) with ESMTP id 22C28E084B for ; Sat, 30 Jun 2012 19:01:50 +0000 (UTC) X-Originating-IP: 217.70.178.144 Received: from mfilter16-d.gandi.net (mfilter16-d.gandi.net [217.70.178.144]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 1F9CBA80B9 for ; Sat, 30 Jun 2012 21:01:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter16-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter16-d.gandi.net (mfilter16-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Sypl6NQO-+bn for ; Sat, 30 Jun 2012 21:01:47 +0200 (CEST) X-Originating-IP: 92.132.176.200 Received: from tsukuyomi.home (APuteaux-553-1-1-200.w92-132.abo.wanadoo.fr [92.132.176.200]) (Authenticated sender: eric.dunand.ml@eriknet.eu) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 87A59A8093 for ; Sat, 30 Jun 2012 21:01:47 +0200 (CEST) Date: Sat, 30 Jun 2012 21:22:51 +0200 From: =?UTF-8?B?w4lyaWM=?= DUNAND To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Problem with sudo Message-ID: <20120630212251.0a08e0a1@tsukuyomi.home> In-Reply-To: <20120630194828.02dbea54@digimed.co.uk> References: <20120630194828.02dbea54@digimed.co.uk> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i486-pc-linux-gnu) X-Face: $0mfGYwhv$~j{HH[5!L5Q>F]Qs>+^Z57T8"L5V)2Pg;dN{BS.\[APfm_~D(gPY&^Ts2P: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 709896d5-d196-4817-a46b-ab7c35e8f960 X-Archives-Hash: 82fa69eb1c2754781fcb4d8f4b0beffa Le Sat, 30 Jun 2012 19:48:28 +0100, Neil Bothwick a =C3=A9crit : > On Sun, 1 Jul 2012 01:27:49 +0800, =E8=B5=B5=E4=BD=B3=E6=99=96 wrote: >=20 > > In some cases , when i run somethings with "sudo" , it tells me > > "Permission Denied" , then i should turn to root . i forgot to > > record the cases . Did anyone have any ideas ? >=20 > Are you trying to redirect the output? That can give this message > because the redirection is performed as the user running sudo, not as > root. >=20 >=20 If Neil is right, you may want to read man tee. It work roughly like that: instead of do sudo echo sthg > /etc/file.cfg echo sthg | sudo tee /etc/file.cfg sudo echo sthg >> /etc/file.cfg echo sthg | sudo tee -a /etc/file.cfg --=20 =C3=89ric DUNAND