:: Re: [DNG] A shell script for networ…
Forside
Slet denne besked
Besvar denne besked
Skribent: KatolaZ
Dato:  
Til: dng
Emne: Re: [DNG] A shell script for network connections
On Sat, Dec 31, 2016 at 10:38:48AM +0000, KatolaZ wrote:

[cut]

>
>
> Hi Steve,
>
> thanks for your encouragement. bash is currently a requirement, since
> I am using a few non-posix little things. So if you want to test it
> and report bugs, please use it under bash atm since a few things will
> not work at all with dash. I hope I will be able to port it to
> posix-sh soon.
>


Hi All,

it turns out that my last statement was wrong. To my own surprise,
setnet.sh seems to be already posix-compliant with a very slight
modification. In particular, it is sufficient to comment out the
keyword "function" in function declarations, which is done with

sed -r -e 's/^function\ /##function\ \n/g' setnet.sh > setnet.dash

and, after having updated the shebang appropriately, setnet.dash can
run with ash/dash, which is posix-compliant. The doubts about posix
compliance were mostly about the management of arrays (I have only a
couple of them, atm), but turned out to be irrelevant. We need to do
more testing now, but this looks indeed promising :)

HND

KatolaZ

-- 
[ ~.,_  Enzo Nicosia aka KatolaZ - GLUGCT -- Freaknet Medialab  ]  
[     "+.  katolaz [at] freaknet.org --- katolaz [at] yahoo.it  ]
[       @)   http://kalos.mine.nu ---  Devuan GNU + Linux User  ]
[     @@)  http://maths.qmul.ac.uk/~vnicosia --  GPG: 0B5F062F  ] 
[ (@@@)  Twitter: @KatolaZ - skype: katolaz -- github: KatolaZ  ]