I just test for version strings. e.g. BASH_VERSION. It isn't ideal or
robust but gets the job done depending on your requirements. There is
no generally great solution.
There are scripts that make better guesses but there aren't any that
are meant for use in a library or that do fine-grained feature
detection. Something like that is on my todo list for some day.

https://www.mirbsd.org/cvs.cgi/contrib/code/Snippets/getshver?rev=HEAD
http://www.in-ulm.de/~mascheck/various/whatshell/whatshell.sh.html
http://stchaz.free.fr/which_interpreter

-- 
Dan Douglas

Reply via email to