Re: implementation of 2-dimensional array in bash - kind request
Thanks. You are right as always. I am trying to master dialog and for my tiny application bash + 2D arrays + dialog should suffice. Darius --- On Sun, 6/7/08, Kees Jongenburger [EMAIL PROTECTED] wrote: From: Kees Jongenburger [EMAIL PROTECTED] Subject: Re: implementation of 2-dimensional array in bash - kind request To: [EMAIL PROTECTED] Cc: Maemo developers mailing-list maemo-developers@maemo.org Date: Sunday, 6 July, 2008, 11:37 AM Hello Darius, On Sat, Jul 5, 2008 at 7:54 PM, Darius Jack [EMAIL PROTECTED] wrote: and have 2D array inmterpreted as one row. so calculating array2D ( ) i-th j-th element as i + (j-1) x row length I agree with Igor what using bash or even better a POSIX shell would be a little insane. Still Dave Taylor have a serries on linuxjounral about shell programming (creating a card game/arrat manipulation) see http://www.linuxjournal.com/article/8704 I think you might find it useful. greetings, P.S. can you stop sending the Send instant messages to your online friends http://uk.messenger.yahoo.com; in every and each mail? Send instant messages to your online friends http://uk.messenger.yahoo.com ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: implementation of 2-dimensional array in bash - kind request
Hello Darius, On Sat, Jul 5, 2008 at 7:54 PM, Darius Jack [EMAIL PROTECTED] wrote: and have 2D array inmterpreted as one row. so calculating array2D ( ) i-th j-th element as i + (j-1) x row length I agree with Igor what using bash or even better a POSIX shell would be a little insane. Still Dave Taylor have a serries on linuxjounral about shell programming (creating a card game/arrat manipulation) see http://www.linuxjournal.com/article/8704 I think you might find it useful. greetings, P.S. can you stop sending the Send instant messages to your online friends http://uk.messenger.yahoo.com; in every and each mail? ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: implementation of 2-dimensional array in bash - kind request
C is a good solution. So is Perl, which comes on OS 2008. So is Python. Perl lets you construct nested lists, which gives you the equivalent in capability to multi-dimensional arrays. Python gives similar constructs. There is no reason IMHO to be writing shell scripts of any kind on a system where Perl and Python are available. Shell programming is just weak for many reasons including lack of data structure capabilities and should be avoided whenever possible. I say this as someone who has accumulated years of shell programming experience in a professional software shop as well as other languages. The strongest of the shell programming languages, namely bash and ksh, have this problem. Perl and Python are practical for exactly the reason that they are good replacements for these shell languages. -Will Kees Jongenburger wrote: Hello Darius, On Sat, Jul 5, 2008 at 7:54 PM, Darius Jack [EMAIL PROTECTED] wrote: and have 2D array inmterpreted as one row. so calculating array2D ( ) i-th j-th element as i + (j-1) x row length I agree with Igor what using bash or even better a POSIX shell would be a little insane. Still Dave Taylor have a serries on linuxjounral about shell programming (creating a card game/arrat manipulation) see http://www.linuxjournal.com/article/8704 I think you might find it useful. greetings, P.S. can you stop sending the Send instant messages to your online friends http://uk.messenger.yahoo.com; in every and each mail? ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: implementation of 2-dimensional array in bash - kind request
William Gordon Rutherdale wrote: C is a good solution. So is Perl, which comes on OS 2008. So is Python. Perl lets you construct nested lists, which gives you the equivalent in capability to multi-dimensional arrays. Python gives similar constructs. There is no reason IMHO to be writing shell scripts of any kind on a system where Perl and Python are available. Shell programming is just weak for many reasons including lack of data structure capabilities and should be avoided whenever possible. I say this as someone who has accumulated years of shell programming experience in a professional software shop as well as other languages. The strongest of the shell programming languages, namely bash and ksh, have this problem. Perl and Python are practical for exactly the reason that they are good replacements for these shell languages. -Will I agree with you here that perl and python are easier to do complex things with than bash or ksh, but I wanted to point out that python may be the better choice on the Nokia tablets. Perl is my favorite language, but the perl install on the tablets is missing a lot of the standard modules. For example, 'perl -e use English;' gives an error. python seems to be a more complete install and even includes gtk, so it's arguably the best choice of scripting language for the platform given what's preinstalled and in extras. Sincerely, Jason ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: implementation of 2-dimensional array in bash - kind request
On Sat, 2008-07-05 at 17:54 +, ext Darius Jack wrote: I need such 2D array to save gps data and more. Hmm ... why not switching to C? It might make far less painfull your effort, and probably would be more efficient. -- Cheers, Igor --- Igor Stoppa Maemo Software - Nokia Devices RD - Helsinki ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers