Skip to content

Commit b396aa0

Browse files
vitkyrkamichal42
authored andcommitted
scripts: decodecode: remove bashisms
Remove bashisms to make scripts/decodecode work with other shells. Signed-off-by: Rabin Vincent <[email protected]> Reviewed-by: WANG Cong <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent c844716 commit b396aa0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/decodecode

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ echo $code
4040
code=`echo $code | sed -e 's/.*Code: //'`
4141

4242
width=`expr index "$code" ' '`
43-
width=$[($width-1)/2]
43+
width=$((($width-1)/2))
4444
case $width in
4545
1) type=byte ;;
4646
2) type=2byte ;;
4747
4) type=4byte ;;
4848
esac
4949

5050
disas() {
51-
${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s &> /dev/null
51+
${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1
5252

53-
if [ "$ARCH" == "arm" ]; then
54-
if [ $width == 2 ]; then
53+
if [ "$ARCH" = "arm" ]; then
54+
if [ $width -eq 2 ]; then
5555
OBJDUMPFLAGS="-M force-thumb"
5656
fi
5757

5858
${CROSS_COMPILE}strip $1.o
5959
fi
6060

6161
${CROSS_COMPILE}objdump $OBJDUMPFLAGS -S $1.o | \
62-
grep -v "/tmp\|Disassembly\|\.text\|^$" &> $1.dis
62+
grep -v "/tmp\|Disassembly\|\.text\|^$" > $1.dis 2>&1
6363
}
6464

6565
marker=`expr index "$code" "\<"`

0 commit comments

Comments
 (0)