I have written a shell script with #!/bin/sh shebang. I've heard that it won't work alongside with Solaris. And that I have to write a korn shell script.
But in one of the threads an individual mentioned that it is possible to make the transition by simply changing the shebang on top.. Which lets it point to a different directory in Solaris where sh is present.
I have no way of knowing if this is true and I would love it if you'd clear it up for me.
Will this method work? And is this the best way?
/bin/sh
isn'tbash
but that doesn't mean you must write a script inksh
. For one thing, what version of solaris and does it havebash
? Try#!/usr/bin/env bash
– Elliott Frisch Oct 24 '14 at 01:58/bin/sh
. If you avoid features specific either to bash or to ksh, there shouldn't be a problem. – Keith Thompson Oct 24 '14 at 05:07#!/usr/xpg4/bin/sh
unfortunately, I can't post it as a reply as the question has been closed. – jlliagre Oct 24 '14 at 21:49/bin/sh
does exist on Solaris. Why would using it be a problem? Is it an older version of the shell? – Keith Thompson Oct 24 '14 at 22:00