Which ksh version
Dave Turner Posted June 19, 0 Comments. Yep, that worked. Thanks, Dave. Dimitre Radoulov Posted June 19, 0 Comments. Register or Login. Welcome back! Reset Your Password We'll send an email with a link to reset your password. Stay ahead! Get the latest news, expert insights and market research, tailored to your interests.
Sign in with email Enter the email address associated with your account. I mean if it's blank, then is ksh necessarily an outdated version?
Was that other forum correct that it might not be set even for newer versions of ksh? Is there just no way to check this at all?
Improve this question. Sildoreth Sildoreth 1, 7 7 gold badges 22 22 silver badges 39 39 bronze badges. Any reason you want two code paths and not just a single one with less awesome code?
In my. Well, you could have two versions of your configuration file perhaps one generated from the other and then distribute out the appropriate version to the machine in question? Another approach could be to simply say "It is only this particular machine which has the problem - I'll find a file or environment variable or something else which only exists here probably AIX or something anyway and test for that instead".
Add a comment. Active Oldest Votes. Improve this answer. Sildoreth 1, 7 7 gold badges 22 22 silver badges 39 39 bronze badges. This would fail if some previously executed code eg:. Show 1 more comment. Gilles 'SO- stop being evil' Gilles 'SO- stop being evil' k gold badges silver badges bronze badges. I don't see any difference when using a subshell. The message I get is bad substitution. I understand what you're saying.
What I'm saying is that the error doesn't redirect. It always prints to the console. Sildoreth Ah. I'd only tested on Linux, and I don't have any of these OSes to test now. That's a little better. For AIX, it works at the command line but curiously starts failing again if I try to place it in a shell function. Show 7 more comments.
For "real" ksh releases i. Bash is the shell, or command language interpreter, for the GNU operating system. The Bourne shell sh is a shell command-line interpreter for computer operating systems.
The Bourne shell was the default shell for Version 7 Unix. To find the current shell instance, look for the process shell having the PID of the current shell instance. Show activity on this post. You will see the result as bash in both cases. Most features can be tested for by trying some construct in a subshell and see if it triggers an error. I overlooked you were asking about doing it from inside a script, not by knowing the path to the tested ksh binary.
Assuming you really want the version of ksh used, and not the features it supports, here is one way to do it using only the strings command that should work on at least on Linux and Solaris:.
0コメント