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

Issue Running patch.sh - [[ not found - bash instead of sh #46

Open
jc97 opened this issue Jul 29, 2021 · 2 comments
Open

Issue Running patch.sh - [[ not found - bash instead of sh #46

jc97 opened this issue Jul 29, 2021 · 2 comments

Comments

@jc97
Copy link

jc97 commented Jul 29, 2021

On my machines (Linux Mint 20.1 and current Kali Linux), patch.sh doesn't work out of the box:

./patch.sh 
ramdisk.img: 1 file pushed. 103.9 MB/s (1346686 bytes in 0.012s)
./patch.sh: 5: [[: not found
./patch.sh: 6: [[: not found
busybox: 1 file pushed. 277.2 MB/s (2074240 bytes in 0.007s)
process.sh: 1 file pushed. 7.7 MB/s (11525 bytes in 0.001s)


***** Grab magisk.zip or magisk.apk first ! *****


adb: error: failed to stat remote object '/data/local/tmp/ramdisk.img': No such file or directory

Due to #!/bin/sh in the first line, the script is executed in sh, even while running it from bash. However, at least on my machine sh doesn't know [[. Only bash (and probably some other shells) knows it.

If I run the script using bash ./patch.sh it works fine.

If I simply change the first line to #!/bin/bash it works fine too. I suggest to change it (as long there is no reason to not change it).

@jc97 jc97 changed the title Issue Running patch.sh - bash instead of sh Issue Running patch.sh - [[ not found - bash instead of sh Jul 29, 2021
@sakyb7
Copy link

sakyb7 commented May 26, 2022

Yeah thats right @jc97 thanks for this thread!!!
I was confused running ./patch.sh gives the same error.

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

3 participants
@jc97 @sakyb7 and others