Gustin Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ralf Mardorf wrote:
>
>> Hi Gustin :)
>>
>> thank you too.
>>
>> Gustin Johnson wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Ralf Mardorf wrote:
>>>
>>>
>>>> Hi :)
>>>>
>>>> some users on that list seems to be fine with writing shell scripts. I'm
>>>> still not fine with it and endeavour to avoid non-POSIX style while
>>>> learning how to write those scripts.
>>>>
>>>>
>>>>
>>> You may wish to have a look at the following:
>>>
>>> http://tldp.org/LDP/Bash-Beginners-Guide/html/
>>>
>>>
>> The problem with all those online guides is e.g. this:
>>
>> http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_10_02.html
>>
>> Array variables are fine for e.g. c like shells and even for pseudo
>> Bourne shells, e.g. on Suse or Debian, but not for real POSIX, e.g.
>> /bin/sh on Ubuntu, anyway I'll take a look at those guides too.
>>
>
> That is a good point. I work with OpenWRT a lot (not just on Linksys
> routers, but on x86 SBCs that we use a lot with our customers). Out of
> the box OpenWRT does not have bash so we have to be mindful of the
> differences. Arrays are so very nice to have, but Bash may not always
> be available. There are a number of these features with Bash that are
> specific to Bash.
>
> Having said that, the vast majority of my scripts are run on Linux or on
> Windows via Cygwin, so I make use of those handy features when I can.
> For any scripts for a full Linux distribution, I can count on Bash being
> there (in fact on every modern distro that I have seen, /bin/sh is
> usually just a symlink to /bin/bash).
>
I tried #!/bin/sh and #!/bin/bash with 64 Studio 3.0-beta3 and both were
not fine with arrays. I needed half of a day to search the web and only
one guy has written that there's a POSIX standard, so instead of using
arrays there's a trick with normal variables to simulate an array: eval
x="\${y${z}}"
Because I know arrays from other languages, I don't need to learn what
an array is and only need to learn this trick, but I guess for somebody
who don't know what an array is and who has to learn this trick in
addition, it would be very hard. Most guides use c like commands, arrays
etc..
I decided to learn POSIX shell script, maybe I should use another shell,
resp. install a bash who understands arrays too? What is more common,
POSIX or any other shell?
>>> and
>>> http://tldp.org/LDP/abs/html/
>>>
>>>
>> Seems to be a good overview, if I e.g. like to know all internal
>> variables and other stuff.
>>
>
> It is a seriously handy guide. I had it printed at a printshop here and
> bound with a coil so that it lays flat on a desk. I don't refer to it as
> much as before, but it is still very handy to have around.
>
A good idea ;). Dunno the actual prices for this in the Ruhrgebiet.
Cheers,
Ralf
_______________________________________________
64studio-users mailing list
[email protected]
http://lists.64studio.com/mailman/listinfo/64studio-users