guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using 'system*' instead of 'system' in 'guix environment'


From: Ludovic Courtès
Subject: Re: Using 'system*' instead of 'system' in 'guix environment'
Date: Thu, 08 Oct 2015 16:59:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"Thompson, David" <address@hidden> 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 ‘sh -c’?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]