Switching users in a bash script?

Brandon Peirce brandon_peirce at hotmail.com
Sun Aug 27 17:44:12 PDT 2006

veritosproject at gmail.com wrote:
>If you really want it fast, you can put almost everything into the
>main script and have the 'su' script just call 'make install'.

I think you are assuming that compiling is done as lfs user and
install is done as root.  That is the normal case, but it's not like
that for package users technique.

BTW, I'm curious why just doing the install in an su script instead
of the whole package in and su script should be faster?  As long
as you don't increase then number of su's then it should make no
difference whether the bulk of commands come before or after
the su (unless you have a very long PATH for one of the users
and shell hashing off).  And anyway, doing an su is not all that
slow compared to the time of a build. I mean I have not seen an
autoconf configure script complete in less than 6 seconds on my
box and there's no way su takes anywhere near even 1 second.


More information about the lfs-support mailing list