I should add a caution - don't just blindly use those code fragments,
they all (or at least most) have bugs - most easy to fix, but I was
just being quick & dirty with them as examples...
kre
Date:Tue, 21 Jun 2016 23:27:41 +0200
From:Edgar =?iso-8859-1?B?RnXf?=
Message-ID: <20160621212740.gl12...@trav.math.uni-bonn.de>
| So it's probably hard to get right.
Non trivial yes, some of the things that can be done which have to be
undone are var assignments,
EF> Unsurprisingly, [ast-ksh] doesn't fork.
EF> Does anyone know how those ksh's achieve that?
kre> I haven't look at their sources, but I would assume they don't fork.
I concur. The most probable way to achieve non-forking is not to fork.
EF> Are there any drawbacks?
kre> [ash] already has co
> so why don't you use PDKSH (/bin/ksh) or pkgsrc's ast-ksh instead of ash
> (/bin/sh) ? Even pkgsrc's GNU Bash would do.
Err, what?
pdksh performs worse that ash. bash surely performs worse. Both fork.
Overall, I don't write for a specific shell, I write for POSIX shells.
While that particular s
Hello Edgar,
so why don't you use PDKSH (/bin/ksh) or pkgsrc's ast-ksh instead of ash
(/bin/sh) ? Even pkgsrc's GNU Bash would do.
I do x=`command` which is almost the same as $(command), using any KSH
or BASH as interpreter. I don't really care about POSIX here as KSH and
BASH syntax is m
Date:Tue, 21 Jun 2016 20:46:11 +0200
From:Edgar =?iso-8859-1?B?RnXf?=
Message-ID: <20160621184611.gi12...@trav.math.uni-bonn.de>
| Does anyone know how those ksh's achieve that? Are there any drawbacks?
I haven't look at their sources, but I would assume they don't
I have a shell script that makes heavy use of Command Substitution, i.e.
x="$(some-command)"
The script takes several seconds to execute, mainly because Command
Substitution takes place in a Subshell Environment and that usually means
a fork().
However, the OS X^W^WmacOS ksh only takes te