7

How to determine version of Bourne shell ( /bin/sh) on Solaris 10 machine?

Deepti
  • 71
  • 1
  • 2
  • I disagree that this question is closed as off topic. My use case relates to programming. I wrote a shell script which worked on one host, but when I moved it to another host it stopped working with a syntax error "[: true: unexpected operator". **Due that** I want to find what is the difference between Bourne shell on who hosts. For that I would like to print a version.

    Moreover, the similar maybe more general question https://stackoverflow.com/questions/38237907/how-to-find-my-shell-version-using-linux-command was not closed as off topic. See my answer there.
    – Alexander Samoylov Oct 24 '19 at 09:01

2 Answers2

0

I don't believe there's any way to do that directly. Why do you need to know?

Dennis Williamson
  • 346,391
  • 90
  • 374
  • 439
  • for bash and korn shells we can find out their versions. I wanted to check some compatibilty issues on Bourne – Deepti Feb 28 '11 at 15:08
  • @Deepti: Bash and Korn are much more advanced than Bourne. If you specify what exactly you're trying to find out, we can help you with tests or interpretation of results or comparisons of features between various shells. – Dennis Williamson Feb 28 '11 at 15:13
  • 1
    Actually I want to find out if my Bourne shell version is version 4.0 or up. There is a problem with command output redirection which is absolutely fine on one Solaris 10 m/c but behaves diffrently in other Solaris 10 m/c. I want to check if the both the machines use the same version of Bourne shell – Deepti Feb 28 '11 at 15:28
  • @Deepti: I would just checksum the files on both machines and compare the result. Use `cksum` or `sum`. – Dennis Williamson Feb 28 '11 at 15:37
  • @Deepti I ran into exactly the same issue. Did you ultimately find a resolution? – Julien Chastang Apr 18 '12 at 18:44
-3

Never worked on solaris, but how about sh --version?

Workes on ubuntu & mac.

Ragnar123
  • 5,174
  • 4
  • 24
  • 34
  • To help understand the downvotes, this answer is unhelpful because on most systems, `/bin/sh` is not actually the Bourne shell, but instead either an alias to some other shell like `bash` or even a different Bash installation. The actual Bourne shell does not have a `--version` commandline argument. – Joald May 03 '23 at 10:26