From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1DqBS5-0003lZ-7H for garchives@archives.gentoo.org; Wed, 06 Jul 2005 15:04:41 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j66F2EPP007953; Wed, 6 Jul 2005 15:02:14 GMT Received: from smtp13.wxs.nl (smtp13.wxs.nl [195.121.6.27]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j66Es2cK007436 for ; Wed, 6 Jul 2005 14:54:02 GMT Received: from [10.0.0.150] (ip3e83ab52.speed.planet.nl [62.131.171.82]) by smtp13.wxs.nl (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0IJ70006UO3I6B@smtp13.wxs.nl> for gentoo-user@lists.gentoo.org; Wed, 06 Jul 2005 16:54:55 +0200 (CEST) Date: Wed, 06 Jul 2005 16:54:41 +0200 From: Holly Bostick Subject: Re: [gentoo-user] sudo echo cannot write to /etc/ files ? In-reply-to: <1120659727.13823.8.camel@capella.catmur.co.uk> To: gentoo-user@lists.gentoo.org Message-id: <42CBF0B1.1020308@planet.nl> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT X-Accept-Language: nl-NL, nl, en User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050624) X-Enigmail-Version: 0.92.0.0 References: <42CBE237.7050508@planet.nl> <1120659727.13823.8.camel@capella.catmur.co.uk> X-Archives-Salt: 994bdd76-31b4-4e1f-9639-0549e80a970f X-Archives-Hash: 1112177689b0da5647605b6142bc770e Edward Catmur schreef: > On Wed, 2005-07-06 at 15:52 +0200, Holly Bostick wrote: > >>Echo is in the sudo-ed group, and echo isn't the problem-- the problem >>is that permission is refused to write to the file itself (which is an >>error *from* echo, so it would seem that echo itself is OK as far as >>sudo goes). Which means that I have to su anyway, to echo to the file, >>which really isn't the point of the exercise. >> >>As I see it, this error can mean only one of two things: >> >>sudo does not give me a login shell (so my UID is 'really' still my UID >>and not root's, and I don't have permission to write to the file); or >> >>there is another, "invisible" cli utility responsible for actually >>writing to the file, which is not sudo-ed. > > > If you're using e.g. "sudo echo package >> /etc/portage/package.unmask" > then the redirection takes place in your shell, not in sudo. > > HTH. > OK, you all likely realize that I responded before I had got the three more messages telling me what to do. I'm sure it will work (three people telling you the exact same thing is pretty convincing ;-) ), but what I don't understand is why/how, if I want to sudo echo 'media-video/xine-ui ~x86' >>/etc/portage/package.keywords changing that to "sudo echo media-video/xine-ui ~x86 >>/etc/portage/package.keywords" is going to write the line media-video/xine-ui ~x86 to /etc/portage/package.keywords-- i.e., why are the internal quotes no longer necessary? Or should it be "sudo echo 'media-video/xine-ui ~x86' >>/etc/portage/package.keywords" or will that *really* screw everything up? (As you see, my understanding of bash is trying to improve, with only very limited success :-) ). Holly -- gentoo-user@gentoo.org mailing list