PTC MKS Toolkit Knowledge Base

Product:MKS Toolkit (All)
Keywords:hashbang, script, first line
Category:Utilities/Knowledge Base

How can I get the MKS Toolkit shells to interpret hashbang (#!) lines in scripts?

Hashbang has been supported since MKS Toolkit 5.2 however, it is not always enabled. You have to set the environment variable HASHBANG to a non zero value to enable this feature.

KornShell and Bash example: (line added to $HOME/profile.ksh)

    export HASHBANG=1

C Shell example: (line added to $HOME/cshrc.csh)

    setenv HASHBANG 1

In the KornShell that came with Toolkit 6.1 (build 209) hashbang lines were ignored in files without a .ksh extension. Newer releases of the KornShell fix this. Check the download area of the Toolkit support site to get the latest shell update or Toolkit release.