sh's man page's description about its diff w ksh is very ambiguous & deserves being clarified?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sh's man page's description about its diff w ksh is very ambiguous & deserves being clarified?

Joseph Mayer
(Topic moved from misc@ https://marc.info/?t=154091182000002&r=1&w=2
as it's a question about whether it's a bug:)


sh's man page (http://man.openbsd.org/sh#DESCRIPTION) says:

"This version of sh is actually ksh in disguise. As such, it also
supports the features described in ksh(1). This manual page describes
only the parts relevant to a POSIX compliant sh."

When I read that originally, I perceived it as that "sh" and "ksh"
normally would have equivalent behavior - which also seems logical
given that their binaries are byte-equivalent.

The meaning I gather from the sentence is that sh and ksh are
equivalent and that instead the man pages will describe different
functionalities that are actually available in both.

Can that phrase in sh's man page be tweaked so that my misunderstanding
no longer is possible?

Do you find my misunderstanding a reasonable reading?

Joseph

Reply | Threaded
Open this post in threaded view
|

Re: sh's man page's description about its diff w ksh is very ambiguous & deserves being clarified?

Jason McIntyre-2
On Wed, Oct 31, 2018 at 03:10:35PM +0000, Joseph Mayer wrote:

> (Topic moved from misc@ https://marc.info/?t=154091182000002&r=1&w=2
> as it's a question about whether it's a bug:)
>
>
> sh's man page (http://man.openbsd.org/sh#DESCRIPTION) says:
>
> "This version of sh is actually ksh in disguise. As such, it also
> supports the features described in ksh(1). This manual page describes
> only the parts relevant to a POSIX compliant sh."
>
> When I read that originally, I perceived it as that "sh" and "ksh"
> normally would have equivalent behavior - which also seems logical
> given that their binaries are byte-equivalent.
>
> The meaning I gather from the sentence is that sh and ksh are
> equivalent and that instead the man pages will describe different
> functionalities that are actually available in both.
>
> Can that phrase in sh's man page be tweaked so that my misunderstanding
> no longer is possible?
>
> Do you find my misunderstanding a reasonable reading?
>
> Joseph
>

morning.

you may have a point, i agree. our sh is really ksh, but when run as sh
it has a few differences. i think it is mainly the case that there is
some functionality not supported when run as sh.

previously the sh page was the same as the ksh page, but with some of
this functionality trimmed out. i'm not sure where we would stop at
attempting to describe how the shells runs. do we need a list of
differences, or is it enough to say they differ in small ways?

when you say "Can that phrase ... be tweaked", i guess i would ask you:
can you provide a diff so that your "misunderstanding is no longer
possible"? it doesn;t have to be a diff - just give me the text you
think is missing.

personally i'd prefer to avoid trying to get into this discussion. you
should just use ksh(1) as the reference page for what the shell can do,
and sh(1) if you want to limit yourself to those aspects described by
posix.

jmc

Reply | Threaded
Open this post in threaded view
|

Re: sh's man page's description about its diff w ksh is very ambiguous & deserves being clarified?

Otto Moerbeek
In reply to this post by Joseph Mayer
On Wed, Oct 31, 2018 at 03:10:35PM +0000, Joseph Mayer wrote:

> (Topic moved from misc@ https://marc.info/?t=154091182000002&r=1&w=2
> as it's a question about whether it's a bug:)
>
>
> sh's man page (http://man.openbsd.org/sh#DESCRIPTION) says:
>
> "This version of sh is actually ksh in disguise. As such, it also
> supports the features described in ksh(1). This manual page describes
> only the parts relevant to a POSIX compliant sh."
>
> When I read that originally, I perceived it as that "sh" and "ksh"
> normally would have equivalent behavior - which also seems logical
> given that their binaries are byte-equivalent.
>
> The meaning I gather from the sentence is that sh and ksh are
> equivalent and that instead the man pages will describe different
> functionalities that are actually available in both.
>
> Can that phrase in sh's man page be tweaked so that my misunderstanding
> no longer is possible?
>
> Do you find my misunderstanding a reasonable reading?
>
> Joseph
>

A differently named exectutable can do completely different things.

sh(1) describes a subset of ksh(1). There are a few exceptions,
see http://man.openbsd.org/ksh#Strict_Bourne_shell_mode

AFAKS the only thing not explicitly mentioned is that starting a shell
like sh will set the sh option.

        -Otto