[lfs-support] Possible Syntax Error in Current "Package User" Hint Build Script[RESOLVED]
beesnees at grm.net
Mon Oct 14 13:55:20 PDT 2013
On 10/12/2013 11:27 AM, Dan McGhee wrote:
> I'm melding my build script to the current one from this hint. I've
> found a possible syntax error and want to see if my thinking is
> correct. Since I've been monitoring this list closely again, i.e.; the
> last three weeks, I've not seen anyone who has had a problem running
> this script. But I think that few people build this way. :)
> Here is the line in question:
> cd "$HOME/xxxbuild/yyysrc" && srcdir="$(pwd)" || exit 1
> <snipped a few paragraphs>
> If <&&> and <||> are logical operators, shouldn't the whole command be
> enclosed in double brackets,
> [[ command1 && command2 || command3 ]]? The other syntax I know would be
> [ command1 -a command2 -o command3 ].
> Of course, this is all predicated on the use of <&&> and <||> as logical
> operators. But if they're not, I don't understand the command.
> Comments? Answers? Recommendations? Rants?
I ran this script for two different packages in Ch. 6 and it behaved
flawlessly. Apparently Ken Moffat was right when he commented that the
syntax function of gedit might be confused. Thanks to all who responded.
This was a good learning and "memory refreshment" situation.
Speaking of learning situations. I just learned to make sure that
there's an "escape route" in scripts run by root. I wrote and ran a
script to allow "follow-on" package users to write to directories
created by an earlier user. (NOTE: This happens in the Package User
hint.) I ran the script and forgot to pass an argument. I just hosed my
LFS build. Oh well. I needed to test something else before Ch. 6 anyway.
Thank goodness I backed up the tool chain.
More information about the lfs-support