Skip to content

shell script gotcha in boot

I use a build process which is sensitive to the exit code of "boot", assuming that everything went OK only if it returns 0. Because the last line of the script uses the && operator, the entire script can exit with a code other than zero if the last file checked does not exist. In my case, "validate" indeed did not exist, and the script failed.

Solution: Replace the && with an if statement:

if test -f $f; then
    chmod +x $f
fi
Trac metadata
Trac field Value
Version 6.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information