[Users] problem run shell script by vzctl exec

Kirill Korotaev dev at sw.ru
Fri Nov 2 07:34:31 EDT 2007


yep. the actual command executed in 2nd case is:
server3:~# vzctl exec 180 echo /root

Kirill

On Fri, 2007-11-02 at 00:50 -0500, Drake Wilson wrote:
> Quoth "hhding.gnu" <hhding.gnu at gmail.com>, on 2007-11-02 11:42:32 +0800:
> > what's the problem?
> > 
> > server3:~# vzctl exec 180 cat hi.sh
> > #!/bin/bash
> > 
> > echo $HOME
> > server3:~# vzctl exec 180 hi.sh
> > /
> 
> Subprocess for bash starts running inside VE 180, begins executing
> hi.sh.  It's got a different environment, and expands $HOME into /,
> then echoes it to stdout.
> 
> > server3:~# vzctl exec 180 echo $HOME
> > /root
> 
> _Current_ shell expands $HOME into /root.  Subprocess for echo starts
> running inside VE 180, with the parameter already expanded.  (vzctl
> doesn't even see the "$HOME".)  It is told to echo "/root" to stdout,
> so it does.
> 
> Does that sound about right?
> 
>    ---> Drake Wilson
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users



More information about the Users mailing list