Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

substring expression < 0 error on macos zsh when patch #9

Open
JaosnHsieh opened this issue Dec 23, 2022 · 4 comments
Open

substring expression < 0 error on macos zsh when patch #9

JaosnHsieh opened this issue Dec 23, 2022 · 4 comments

Comments

@JaosnHsieh
Copy link

command

./apk.sh patch ./base.apk --arch arm

error

./apk.sh: line 209: -3: substring expression < 0

it's this line if [ ! -f "${FRIDA_SO_XZ::-3}" ]; then in the shell. Not sure how to fix it.

	FRIDA_SO_XZ="$APK_SH_HOME/$GADGET"

	if [ ! -f "${FRIDA_SO_XZ::-3}" ]; then
@ax
Copy link
Owner

ax commented Dec 23, 2022

Got a similar issue here #8. macOS with Bash v3.2.57.
Try apk.sh v1.0.2 it should be ok with bash 3.x. Maybe this fix this zsh issue also.
Let us know.

@Farfar
Copy link

Farfar commented Jan 1, 2023

Try apk.sh v1.0.2 it should be ok with bash 3.x. Maybe this fix this zsh issue also.

Tried both zsh and bash 3.2.57 but same issue.

@ax
Copy link
Owner

ax commented Jan 2, 2023

Very same error?

@Xetera
Copy link

Xetera commented Jul 27, 2023

You're likely using a more up to date version of bash through homebrew which you can fix by replacing the shebang with

#!/opt/homebrew/bin/bash

if that's the case you're also gonna run into problems with grep which you can solve by installing gnu grep with brew install grep, adding the installed binaries to your PATH and replacing instances of grep with ggrep.

I'm sure there are better ways of solving these problems but this worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants