Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Apr 2007 10:30:15 -0400
From:      Lowell Gilbert <freebsd-questions-local@be-well.ilk.org>
To:        Elan Marikit <emarikit@infoweapons.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: set env in chroot script
Message-ID:  <44abwsd11k.fsf@Lowell-Desk.lan>
In-Reply-To: <463193FE.4090504@infoweapons.com> (Elan Marikit's message of "Fri\, 27 Apr 2007 14\:11\:10 %2B0800")
References:  <463193FE.4090504@infoweapons.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Elan Marikit <emarikit@infoweapons.com> writes:

> I am a newbie of FreeBSD and I want to know how to set environment
> inside chroot in a shell script.
>
> My script looks like this:
> chroot $NEWROOT /bin/sh -c "<command>"
>
> And I want to set an environment, before the <command>.
>
> Is it possible that it will inherit my parent environment? like the
> environment set in my script?

According to the chroot(8) manual, only the SHELL value will
be inherited.

Try making a wrapper script to set the values you want, and
call the command from inside that script.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44abwsd11k.fsf>