Use posix shell variable expansion substitution instead of subshells with sed

This commit is contained in:
Martin Storsjö committed 2018-10-08 14:13:42 +03:00
1 parent 0ec597b1bb
commit 818766d3d4
5 files changed
+18 -13

No files matched your search

+3 -2
View File
@@ -19,8 +19,9 @@ if [ "$1" = "-v" ]; then
exit 0
fi
TARGET="$(basename $0 | sed 's/-[^-]*$//')"
ARCH=$(echo $TARGET | sed 's/-.*//')
BASENAME="$(basename "$0")"
TARGET="${BASENAME%-*}"
ARCH="${TARGET%%-*}"
case $ARCH in
i686) M=i386pe ;;
x86_64) M=i386pep ;;