Skip to content

Commit 7de3d69

Browse files
committed
set -e for e9compile.sh
It is easier to debug when the script does not fall through errors. The grep invocation is moved inside the predicate to not fail when there is no match.
1 parent 5b17f53 commit 7de3d69

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

e9compile.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1717

18+
set -e
19+
1820
if [ -t 1 ]
1921
then
2022
RED="\033[31m"
@@ -95,8 +97,7 @@ then
9597
exit 1
9698
fi
9799

98-
RELOCS=`readelf -r "$BASENAME" | head -n 10 | grep 'R_X86_64_'`
99-
if [ ! -z "$RELOCS" ]
100+
if readelf -r "$BASENAME" | head -n 10 | grep -q 'R_X86_64_'
100101
then
101102
echo >&2
102103
echo "${RED}warning${OFF}: the generated file (${YELLOW}$BASENAME${OFF}) contains relocations" >&2

0 commit comments

Comments
 (0)