Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-26-2013, 11:59 AM   #1
xC0re
Junior Member
xC0re began at the beginning.
 
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.
xC0re is offline   Reply With Quote
Old 05-26-2013, 02:16 PM   #2
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
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?
tshering is offline   Reply With Quote
Advert
Old 05-26-2013, 02:23 PM   #3
xC0re
Junior Member
xC0re began at the beginning.
 
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
It's nearly in every script I wrote.
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.
xC0re is offline   Reply With Quote
Old 05-26-2013, 03:17 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
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)?
PeterT is offline   Reply With Quote
Old 05-26-2013, 03:23 PM   #5
xC0re
Junior Member
xC0re began at the beginning.
 
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.
xC0re is offline   Reply With Quote
Advert
Old 05-26-2013, 03:37 PM   #6
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
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.
PeterT is offline   Reply With Quote
Old 05-27-2013, 03:44 AM   #7
latepaul
Wizard
latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.latepaul ought to be getting tired of karma fortunes by now.
 
latepaul's Avatar
 
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.
latepaul is offline   Reply With Quote
Old 05-27-2013, 05:29 AM   #8
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
Just for information. sleep works on my touch.
tshering is offline   Reply With Quote
Old 05-27-2013, 02:41 PM   #9
xC0re
Junior Member
xC0re began at the beginning.
 
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
xC0re is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 11:34 PM.


MobileRead.com is a privately owned, operated and funded community.