You are not logged in.

#21 2017-06-10 14:25:44

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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.(

Offline

#22 2017-06-10 14:54:05

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,901

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

Head_on_a_Stick wrote:
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 smile


Real Men Use Linux

Offline

#23 2017-06-10 16:19:01

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,028

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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

lol  lol  lol  lol  lol


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#24 2017-06-10 16:22:49

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,028

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

brontosaurusrex wrote:

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

#25 2017-06-10 16:29:57

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,901

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

Sector11 wrote:
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

lol  lol  lol  lol  lol

+1 to that!


Real Men Use Linux

Offline

#26 2017-06-10 17:11:50

cpoakes
Member
Registered: 2016-12-02
Posts: 108

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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

#27 2017-06-10 18:53:54

DeepDayze
Like sands through an hourglass...
From: In Linux Land
Registered: 2017-05-28
Posts: 1,901

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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?


Real Men Use Linux

Offline

#28 2017-06-10 19:36:49

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

^ 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

#29 2017-06-10 19:47:58

cpoakes
Member
Registered: 2016-12-02
Posts: 108

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

DeepDayze wrote:
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

#30 2017-06-10 19:54:56

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

cpoakes wrote:

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

#31 2017-06-10 20:01:09

cpoakes
Member
Registered: 2016-12-02
Posts: 108

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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. 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

#32 2017-06-10 20:07:16

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

cpoakes wrote:
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

#33 2017-06-10 20:27:53

cpoakes
Member
Registered: 2016-12-02
Posts: 108

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

^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

#34 2017-08-12 10:58:41

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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

#35 2017-09-03 15:48:48

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: MirBSD™ Korn Shell (mksh) 56b-1 backport

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

Board footer

Powered by FluxBB