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 1DqP2W-0002Gd-KU for garchives@archives.gentoo.org; Thu, 07 Jul 2005 05:35:13 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j675WNIU025378; Thu, 7 Jul 2005 05:32:23 GMT Received: from smtp108.mail.sc5.yahoo.com (smtp108.mail.sc5.yahoo.com [66.163.170.6]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j675RmeM003923 for ; Thu, 7 Jul 2005 05:27:49 GMT Received: (qmail 10682 invoked from network); 7 Jul 2005 05:28:46 -0000 Received: from unknown (HELO ?192.168.50.105?) (richard?j?fish@212.180.33.26 with plain) by smtp108.mail.sc5.yahoo.com with SMTP; 7 Jul 2005 05:28:46 -0000 Message-ID: <42CCBE31.9060304@asmallpond.org> Date: Thu, 07 Jul 2005 07:31:29 +0200 From: Richard Fish User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050623) X-Accept-Language: en-us, en 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 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] sudo echo cannot write to /etc/ files ? References: <42CBE237.7050508@planet.nl> <200507061620.47943.gentoo@depardo.ch> <42CBF70B.4010703@planet.nl> <42CCA4BE.5000904@volumehost.com> In-Reply-To: <42CCA4BE.5000904@volumehost.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 8c7c83fb-27ce-497f-b198-4f7b7094d5aa X-Archives-Hash: e53b2933e8126429532aeb1048005e9b Boyd Stephen Smith Jr. wrote: > > You want: > sudo "echo 'media-video/xine-ui ~x86' >> /etc/portage/package.keywords" > No, I'm sorry, this is completely false. Running sudo "echo 'media-video/xine-ui ~x86' >> /etc/portage/package.keywords" causes sudo to search the PATH for a *single* executable file named "sudo echo 'media-video/xine-ui ~x86' >> /etc/portage/package.keywords". It will find no such file, and report "command not found". Besides, the echo command doesn't support the *shell* redirection operators. It is the *shell* that interprets those. Echo just prints every argument it receives to stdout, so even if you managed to pass ">>" to echo in it's argv, it would just print those characters to its stdout. > This cause the command > echo 'media-video/xine-ui ~x86' >> /etc/portage/package.keywords > to be passed to the sudo shell which causes the bash built-in: sudo has no builtin bash or bash-like shell. -Richard -- gentoo-user@gentoo.org mailing list