![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2013
Device: Kobo Mini
|
[Bash] 'sleep' x becomes 'leep' x
Hello,
I just started to write small scripts for my Kobo Mini. At some points I need the script to pause for a few seconds. So I used the sleep command. Unfortunately the scripts don't work as they should. After every 'sleep' command I get the error: 'leep: invalid number ' Independent of the number I use. So 'sleep 2' --> 'leep: invalid number ' 'sleep 10' --> 'leep: invalid number ' Any ideas how I can solve this Problem or another way to pause a script for a few seconds? Thanks ![]() Last edited by xC0re; 05-26-2013 at 12:38 PM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Looks like something is eating the first letter of the command, maybe some uncommon character used for indentation?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2013
Device: Kobo Mini
|
I didn't use any indentation.
One of the scripts looks like this. Code:
#!/bin/sh sleep 10 killall nickel killall hindenburg sleep 3 crond & /bin/sh /mnt/onboard/update.sh Astonishingly one script works. But only if its name ist update.sh. If I rename the script but keep erverything else exactly the same, it throws also this error. This is extremely strange. I have never seen such an error before. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,504
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Are these scripts being saved in Unix format (ie ending with only a linefeed) or DOS format (carriage return and linefeed)?
|
![]() |
![]() |
![]() |
#5 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2013
Device: Kobo Mini
|
I've saved them with Kate on Kubuntu in Unix format.
Should I use the DOS format? Last edited by xC0re; 05-26-2013 at 03:25 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,504
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
No... Unix format is perfect! Just wanted to make sure though.
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,270
Karma: 10468300
Join Date: Dec 2011
Device: a variety (mostly kindles and kobos)
|
The error is curious because it's not saying that it doesn't understand the command "leep" it's saying the number is invalid. I've checked on my Linux desktop and that's the same error I get out of busybox's sleep if I give it a non-numeric. So it seems the "s" is not being eaten so much as not displayed.
Doesn't explain why it's not accepting 3 and 10 as numbers though. |
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Just for information. sleep works on my touch.
|
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2013
Device: Kobo Mini
|
------Problem solved------
I wrote a few different scripts for testing and I think I found the reason that some scripts don't work. Thanks @latepaul @PeterT for bringing me there I transfered the scripts via Filezilla on my Kobo. Somehow through this transfer they seem to get messed up (I used auto detection instead of binary transfer. Maybe thats why). If I log on via telnet on my Kobo and download the scripts via wget they work fine. It might work with Filezilla in binary mode but at the moment everything works fine and I don't want to touch anything on the Kobo ![]() |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
An available bash 4.2 for KT | silverzhao | Kindle Developer's Corner | 2 | 02-06-2013 10:37 AM |