On 7/6/2022 3:53 AM, Frank Winkler wrote:
Hi there !
I have a couple of completely different ksh scripts (#!/bin/ksh) which
sometimes behave differently depending on whether I call them directly
by "<script>" or by "ksh <script>" (from an interactive bash). It's
the same ksh binary in both cases.
To my understanding, roughly the same things should happen. In the
latter case, is one more shell started? Is the first ksh replaced by
the one from inside the script? Actually, it seems that some
comparisons do different things in both cases and it looks like the
second call mostly does what is expected. I can see the issue on
Solaris and on macOS.
Any hints?
fw
Maybe the `ksh` that's first in your PATH (and so invoked when you call
ksh on the command line) isn't `/bin/ksh`, maybe it's some other version
of ksh (ksh88, ksh93, mksh, pdksh, etc.). Try `ksh --version` and
`/bin/ksh --version` or whatever your ksh version supports to identify
itself to see if they're different. Without a minimal code sample that
can reproduce the problem it's hard to guess at what else might be an
issue.
Ed.
Hi there !
I have a couple of completely different ksh scripts (#!/bin/ksh) which sometimes behave differently depending on whether I call them directly
by "<script>" or by "ksh <script>" (from an interactive bash). It's the
same ksh binary in both cases.
To my understanding, roughly the same things should happen. In the
latter case, is one more shell started? Is the first ksh replaced by the
one from inside the script?
Actually, it seems that some comparisons do
different things in both cases and it looks like the second call mostly
does what is expected. I can see the issue on Solaris and on macOS.
Hi there !
I have a couple of completely different ksh scripts (#!/bin/ksh) which sometimes behave differently depending on whether I call them directly
by "<script>" or by "ksh <script>" (from an interactive bash). It's the
same ksh binary in both cases.
To my understanding, roughly the same things should happen. In the
latter case, is one more shell started? Is the first ksh replaced by the
one from inside the script? Actually, it seems that some comparisons do different things in both cases and it looks like the second call mostly
does what is expected. I can see the issue on Solaris and on macOS.
Any hints?
fw
Hi there !
I have a couple of completely different ksh scripts (#!/bin/ksh) which sometimes behave differently depending on whether I call them directly
by "<script>" or by "ksh <script>" (from an interactive bash). It's the
same ksh binary in both cases.
To my understanding, roughly the same things should happen. In the
latter case, is one more shell started? Is the first ksh replaced by the
one from inside the script? Actually, it seems that some comparisons do different things in both cases and it looks like the second call mostly
does what is expected. I can see the issue on Solaris and on macOS.
Any hints?
Hi there !
I have a couple of completely different ksh scripts (#!/bin/ksh) which sometimes behave differently depending on whether I call them directly
by "<script>" or by "ksh <script>" (from an interactive bash). It's the
same ksh binary in both cases.
On 06.07.2022 14:31, I wrote:
I'll do but I think I'll first have to find out what exactly "it
doesn't work" means, i.e. the exact line(s) where the difference
occurs. This will require some tests but should be easy to do. Please
stay tuned ...
Just to prevent you from thinking I lost track: I still wasn't able to
find the piece of code that causes the actual difference in behavior but
I'll keep trying ...
Regards
fw
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (2 / 14) |
Uptime: | 22:02:06 |
Calls: | 6,667 |
Calls today: | 1 |
Files: | 12,216 |
Messages: | 5,337,347 |