Android sh script error "[: not found" (UTF8? ANSI? Windows? linux?) - xda-developers
May want to check that out too...
May want to check that out too...
Upvote
0
ALternatively, try this first...
Change the first line from:
toCode:#!/system/bin/sh
COULD work (not entirely sure, but it's worth a shot.)Code:#!/system/bin/bash
dude i fixed it!!!!!!!!!!!!!!!
it was as simple as:
#!/system/bin/sh
if busybox [ -e /sys/blah blah blah
the "busybox" made all the difference before the bracket lmao
I told you to try code that had that in it like 200 posts ago >.<
Regardless, glad you got it working ^_^
Finally had some time to sit down, i tryed both and im getting a syntax error, "fi" expecting "then"say, do me a favor.
Try this:
and let me know everything it outputs.Code:#!/system/bin/sh set -x if [ -e /sys/class/leds/button-backlight/max_brightness ]; then if [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ] then echo 15 > sys/class/leds/button-backlight/max_brightness else echo 0 > sys/class/leds/button-backlight/max_brightness fi fi
Finally had some time to sit down, i tryed both and im getting a syntax error, "fi" expecting "then"
#!/system/bin/sh
if [ -e /sys/class/leds/button-backlight/max_brightness ];
then
if [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
echo 15 > sys/class/leds/button-backlight/max_brightness
else
echo 0 > sys/class/leds/button-backlight/max_brightness
fi
fi
#!/system/bin/sh
if busybox [ -e /sys/class/leds/button-backlight/max_brightness ];
then
if busybox [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
echo 15 > sys/class/leds/button-backlight/max_brightness
else
echo 0 > sys/class/leds/button-backlight/max_brightness
fi
fi
[/end]
It COULD, but I don't see any reason as to why it should.
Try using this, and let me know what happens...
Code:#!/system/bin/sh if [ -e /sys/class/leds/button-backlight/max_brightness ]; then if [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ] then busybox echo 15 > sys/class/leds/button-backlight/max_brightness busybox chmod 755 /sys/class/leds/button-backlight/max_brightness else busybox echo 0 >sys/class/leds/button-backlight/max_brightness busybox chmod 755 /sys/class/leds/button-backlight/max_brightness fi fi
#!/system/bin/sh
if busybox [ -e /sys/class/leds/button-backlight/max_brightness ]; then
if busybox [ `cat /sys/class/leds/button-backlight/max_brightness` -eq 0 ]
then
busybox echo 15 > sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
else
busybox echo 0 >sys/class/leds/button-backlight/max_brightness
busybox chmod 755 /sys/class/leds/button-backlight/max_brightness
fi
fi
Nvm, fixed it. Went back and copy the working codes for the soft keys and replaced the path
Didn't even see that you had an issue; sorry. Was up all night doing some final testing, and setup on the stripper app.
Today, and tonight I'm going to build it's counterpart (the stock apps installer) and then I'm going to get to work on ZV8. (Unfortunately it's easier for me to do it in that order, since I'll need the installer for the stock unrooted versions of zv8, 9, and A.
Glad you got it working bro!
I'm reading about making an app for the Esteem to toggle these, mind sharing some tips? easy to use programs/tools?
Mine doesn't have init.d either, and I'm on stock zv9. I'm rebooting after isntalling script manager to see if it pops up, and if not, I'm going to manually create that folder, then try runnning the script and see what happens. Just give me a bit, and I'll post back with more details, and results. Sorry for the wait.
It work for me by just extracting it in SD then running the script, I didn't move it or make any folder. Is that normal?
there's no init.d folder and i cannot create one.. it says cannot create file
oops i forgot how to mount rw i did it before but i forgot
Check all my toggles
[GUIDE/MOD]*UPDATED* 6/14/12. Softkeys LED light TOGGLE - Android Forums
[GUIDE/MOD]*UPDATED* 6/13/12. Softkeys LED light TOGGLE
My OP looks like garbage compared to yours lol, and if you dont mind i might check out your flashlight switch and add it to the OP?
My OP looks like garbage compared to yours lol, and if you dont mind i might check out your flashlight switch and add it to the OP?
We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.