From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Using 'system*' instead of 'system' in 'guix environment' Date: Thu, 08 Oct 2015 16:59:56 +0200 Message-ID: <87vbahpfrn.fsf@gnu.org> References: <87io6iqhbt.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87ziztyext.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkCfr-0004P6-EP for guix-devel@gnu.org; Thu, 08 Oct 2015 11:00:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkCfo-0004yJ-9V for guix-devel@gnu.org; Thu, 08 Oct 2015 11:00:03 -0400 In-Reply-To: (David Thompson's message of "Thu, 8 Oct 2015 08:41:17 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: "Thompson, David" Cc: guix-devel "Thompson, David" skribis: > I disagree, and here's why. Going back to the sudo/ssh example, it's > not possible to do 'cd /bar; frob' naively because this... > > sudo cd /bar; frob > > ...is two commands. And this doesn't work either because it's not a > valid string for exec: > > sudo 'cd /bar; frob' > > However, we can just do the 'sh -c' trick! > > sudo sh -c 'cd /bar; frob' > > This is essentially what you propose having built-in, but I think it > would be best to leave it out. That way we can simply use 'system*' > and users that want to execute an inline Bash script can do so using > the method they most likely already know about from tools like sudo > and ssh. > > guix environment --ad-hoc guile -- guile -c '(frob)' > > guix environment --ad-hoc guile -- sh -c "cd bar/; guile -c '(frob)'" > > This has the additional advantage that the first process created > inside containers will be PID 1, not 2. > > Does this counter-proposal sound OK? Yes it does; you win. ;-) I guess we must still support -E for compatibility. Probably it should do an implicit =E2=80=98sh -c=E2=80=99? Thanks, Ludo=E2=80=99.