MKS Toolkit - Running / Porting UNIX to Windows
Quick Links
Register Software
Report a Problem
Supported Versions
Support Services
Support Policies
Update Policy
Help me choose which MKS Product will best fit our needs (MKS Toolkit; MKS X/Server)

Request an Evaluation Copy
Request Price Quote
 
More Information
 
Call:
(North America)
1-703-803-3343
1-800-637-8034
 
(Europe)
+49 (0) 89 32106 576
or
Contact Us
 
 
 
 
 
 
 
 
Knowledge Base Knowledge Base
Section:IO
Product:MKS Toolkit (All)
Version:
OS:All
Keywords:PATHEXT, SHPATHEXT, file extension
Category:Utilities/Knowledge Base


Why can't the MKS KornShell find my scripts unless I type the extension?


If you enter a filename without an extension, the MKS KornShell will look for the file with one of the following extensions (by default):

  • .exe
  • .ksh
  • .com
  • .bat (Win9x/Me) or .cmd (other Windows systems)
  • no extension

To allow you to change this list, the PATHEXT environment variable was added to Toolkit 6.1. If set, its value will replace the default list above. By default PATHEXT is unset. However, if you start your MKS KornShell from a Windows command line (command.com and cmd.exe) PATHEXT will be set. It will not include .ksh or no extension entries. This behavior can be avoided by setting PATHEXT manually in your environ.ksh, or by using any MKS KornShell after build 209 (i.e. a current version of the MKS Toolkit). In these newer shells, if PATHEXT is set, .ksh and no extension are always added to its list. This happens internally so you won't see them if you display PATHEXT.

Current versions of the MKS KornShell have an environment variable, SHPATHEXT, which supercedes PATHEXT. If it is set, PATHEXT is ignored. You should use this variable if you want to customize the list of extensions searched for. Here is how to set SHPATHEXT to maintain the pre-6.1 default behaviour and add the perl and an alternate shell script extension:

    export SHPATHEXT='.exe;.com;.bat;.cmd;.ksh;;.pl;.sh'


[ UNIX on Windows Home | Site Map | MKS Toolkit Products | Sales | Services | Support | RSS ]
[ PC X Server | Secure Shell (SSH) Solutions | Feedback |
© 1995 - 2014 MKS Inc. All Rights Reserved