On 08/01/2016 05:11 μμ, Read, James C wrote:
No, && is the logical AND. When it's between two commands,
the second is executed only if the first succeeds.
I don't understand why you used it since you don't know what it does.

That's what I thought it does. And that's why I used it. I put it at the end of 
all commands so that if any of them failed I would know about it.

What I don't really understand is how this then causes variables to go out of 
scope.

I hope William will bear with me.

CC=$LFS_TGT-gcc &&
AR=$LFS_TGT-ar &&
RANLIB=$LFS_TGT-ranlib &&
../binutils-2.25.1/configure --prefix=/tools --disable-nls --disable-werror --with-lib-path=/tools/lib --with-sysroot

What bash understands with that is:
set CC var AND if succeeds set AR AND if succeeds set RANLIB
AND if succeeds execute configure. The  three vars' settings
and the configure are separate commands.
They are not in one command line.
configure has #! /bin/sh on top. That means that a new shell will start
that will NOT have CC AR and RANLIB in it's environment because of the &&'s.

CC=$LFS_TGT-gcc                \
AR=$LFS_TGT-ar                 \
RANLIB=$LFS_TGT-ranlib         \
../binutils-2.25.1/configure   \
    --prefix=/tools            \
    --disable-nls              \
    --disable-werror           \
    --with-lib-path=/tools/lib \
    --with-sysroot

What bash understands with that is:
set CC AR and RANLIB and pass them to the environment of the shell that
will execute configure because they are in configure's command line.
The `\' is line continuation.

--
Thanos
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to