![]() |
2012-04-27
, 15:19
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#2
|
![]() |
2012-04-27
, 15:32
|
Posts: 145 |
Thanked: 304 times |
Joined on Jan 2010
@ Milton Keynes, UK
|
#3
|
08
Integers with leading "0" are interpreted as octal, so 08 is an illegal
octal number.
Remove the leading "0".
Nicolai
![]() |
2012-04-27
, 15:37
|
Posts: 701 |
Thanked: 585 times |
Joined on Sep 2010
@ London, England
|
#4
|
a=$(echo "( $a * 60 ) + $x" | bc )
The Following 8 Users Say Thank You to retsaw For This Useful Post: | ||
![]() |
2012-04-27
, 15:52
|
Posts: 145 |
Thanked: 304 times |
Joined on Jan 2010
@ Milton Keynes, UK
|
#5
|
![]() |
2012-04-27
, 16:40
|
Posts: 244 |
Thanked: 354 times |
Joined on Jul 2010
@ Scotland
|
#6
|
#!/bin/bash LIFE=042 # Will return 34 as LIFE is interpreted as octal echo $((LIFE)) # Force decimal representation LIFE=$((10#${LIFE})) # Should return the proper meaning of life echo $((LIFE))
![]() |
2012-04-27
, 16:58
|
Posts: 701 |
Thanked: 585 times |
Joined on Sep 2010
@ London, England
|
#7
|
The Following 3 Users Say Thank You to retsaw For This Useful Post: | ||
![]() |
2012-04-27
, 17:06
|
Posts: 244 |
Thanked: 354 times |
Joined on Jul 2010
@ Scotland
|
#8
|
Which while it works with bash, the N900 by default uses the ash shell built in to busybox and it doesn't work with that.
![]() |
2012-04-27
, 18:07
|
Posts: 805 |
Thanked: 1,605 times |
Joined on Feb 2010
@ Gdynia, Poland
|
#9
|
The Following 6 Users Say Thank You to misiak For This Useful Post: | ||
![]() |
2012-04-27
, 18:32
|
Posts: 701 |
Thanked: 585 times |
Joined on Sep 2010
@ London, England
|
#10
|
The Following 3 Users Say Thank You to retsaw For This Useful Post: | ||
I think i've found a little bug but would love for someone to confirm?
Basically I have this script
This works on a unix box that I had access to but on the N900 I get the following error
Thanks
jamie
UPDATE:
I've found that if I set IN to the following it works except for the lines in red italics? how wierd is that?
IN=00:00:19.12
IN=00:01:19.12
IN=00:02:19.12
IN=00:03:19.12
IN=00:04:19.12
IN=00:05:19.12
IN=00:06:19.12
IN=00:07:19.12
IN=00:08:19.12
IN=00:09:19.12
IN=00:10:19.12
IN=00:11:19.12
IN=00:12:19.12
IN=00:13:19.12
IN=00:14:19.12
IN=00:15:19.12
IN=00:16:19.12
IN=00:17:19.12
IN=00:18:19.12
IN=00:19:19.12
IN=00:20:19.12
Last edited by jamiefuller; 2012-04-27 at 15:08.