You are not logged in.
I haven't yet been able to find any hint that mksh supports associative arrays btw.
Yes, you are right and I must have been very confused yesterday, I have edited my old posts.
I've now made more U-turns in this thread than Theresa May... 8.(
Offline
johnraff wrote:I haven't yet been able to find any hint that mksh supports associative arrays btw.
Yes, you are right and I must have been very confused yesterday, I have edited my old posts.
I've now made more U-turns in this thread than Theresa May... 8.(
Seems all that caffeine is kicking in nicely lol. But these are good ideas to kick around
Real Men Use Linux
Offline
I've now made more U-turns in this thread than Theresa May... 8.(
BUNSEN QUOTE OF THE DAY - BUNSEN QUOTE OF THE DAY - BUNSEN QUOTE OF THE DAY
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
All this is for a new thread.
Please keep me informed when you do so.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Head_on_a_Stick wrote:I've now made more U-turns in this thread than Theresa May... 8.(
BUNSEN QUOTE OF THE DAY - BUNSEN QUOTE OF THE DAY - BUNSEN QUOTE OF THE DAY
![]()
![]()
![]()
![]()
+1 to that!
Real Men Use Linux
Offline
Thanks for the benchmarks. A while back, I changed to dash scripts (as #!/bin/sh) because they outperform bash and are generally portable between *nix POSIX shells. Utility checkbashisms from package devscripts was useful in conversion.
Offline
Thanks for the benchmarks. A while back, I changed to dash scripts (as #!/bin/sh) because they outperform bash and are generally portable between *nix POSIX shells. Utility checkbashisms from package devscripts was useful in conversion.
So dash scripts should convert easily to work with mksh/csh/ksh93?
Real Men Use Linux
Offline
^ dash scripts should be POSIX-compliant and that standard was derived from the Korn Shell itself so all dash scripts should run with a ksh shebang.
Converting bashisms to POSIX (dash) scripts is the tricky bit and the reason why Debian still uses bash for most some system scripts.
EDIT: 's/most/some/'
Last edited by Head_on_a_Stick (2017-06-10 20:11:54)
Offline
cpoakes wrote:Thanks for the benchmarks. A while back, I changed to dash scripts (as #!/bin/sh) because they outperform bash and are generally portable between *nix POSIX shells. Utility checkbashisms from package devscripts was useful in conversion.
So dash scripts should convert easily to work with mksh/csh/ksh93?
Dash is nearly 100% POSIX compliant; it fails to supply the $LINENO environment variable (to the chagrin of developers whose build tools leave them dependent on the slower bash). And it implements official POSIX extensions for local variables and echo backslash escapes plus "-n" newline suppression.
For the Korn shells, they are easy to convert and I generally expect them to work as-is. Korn shell is not my native environment, but I vaguely remember mksh supports the same POSIX extensions and might have an ambiguity/difference in parameter splitting (help me Korn fans?).
For the C shell (tcsh,csh), not just no, hell no. There is nothing POSIX compliant about a C shell and it is often criticized as a poor choice for scripting.
Offline
For the Korn shells, they are easy to convert and I generally expect them to work as-is. Korn shell is not my native environment, but I vaguely remember mksh supports the same POSIX extensions and might have an ambiguity/difference in parameter splitting (help me Korn fans?).
The mksh package supplies an lksh binary that will "follow POSIX most closely" if used as /bin/sh (according to the package page).
Offline
Converting bashisms to POSIX (dash) scripts is the tricky bit and the reason why Debian still uses bash for most system scripts.
I take issue with this assertion. Debian developed dash to speed up the system, and the majority of scripts use "#!/bin/sh" linked to /bin/dash (236 instances vs 55 instances in a quick grep of /etc/init.d, /bin, /sbin, /usr/bin, /usr/sbin).
You are correct about the bash scripts, conversion can be tricky. But a concerted (and successful) Debian team effort was made to use dash for performance improvements.
Last edited by cpoakes (2017-06-10 20:02:19)
Offline
Head_on_a_Stick wrote:Converting bashisms to POSIX (dash) scripts is the tricky bit and the reason why Debian still uses bash for most system scripts.
I take issue with this assertion.
Yes I know that /bin/sh was linked to /bin/dash but I was referring to the many system scripts that still use a bash shebang.
EDIT: "most" was wrong though, certainly.
There was an attempt to shift away from the reliance on such a bloated, slow shell but some of the features were not easily reproducible in POSIX.
Give me a bit & I'll try to find the bugs.debian.org thread...
Last edited by Head_on_a_Stick (2017-06-10 20:14:51)
Offline
^Oh I most definitely agree - some bash scripts still exist precisely because of conversion problems. I have some rarely used scripts (12 of 120) unconverted from bash to dash, generally because I am lazy. Two solely because I haven't bothered to mimic bash camel case parameter transformation!
A thread reference isn't necessary, but I will appreciate having the documentation of the specific cases not tackled by the Debian team.
Last edited by cpoakes (2017-06-10 20:28:33)
Offline
Upstream has released version 56 (R56) and I have bumped the packages in the OBS, either update & upgrade or install the new .deb to change.
Offline
Updated to R56b, this is a bugfix-only release and all users should upgrade:
https://www.mirbsd.org/mksh.htm#clog
Sorry about the delay, I forgot to bump this when I updated my AUR packages.
EDIT: I also now have a stretch backport available on request.
Last edited by Head_on_a_Stick (2017-09-03 15:49:32)
Offline