Using shell scripts

Some Win32 programs behave unexpectedly when you run them from within Interix. This usually occurs because the Win32 program uses the contents of an environment variable that has been set by Interix. Win32 programs expect variables to be in the Win32 format, but Interix variables use a POSIX format. This can cause Win32 programs to misinterpret the string values of variables.

Win32 programs use with the Interix PATH variable. This is possible because the value of PATH is automatically flipped to the Win32 format. The PATH variable is the only variable that flips from a POSIX format to a Win32 format. If a Win32 program is dependent on any variables other than PATH, the variables should be converted to a Win32 format before you run the program. An effective way of converting dependent environment variables is through the use of shell scripts.

For example, suppose that you wanted to run a Win32 version of the emacs program. The emacs program examines the contents of HOME and PATH (among other variables). HOME contains a path name; because you are running a Win32 program, you must convert the value of HOME to a Win32 format. Interix provides a command called posixpath2nt(1) to convert path names. Because you do not want this change to affect other Interix programs, you can do the conversion from within a shell script.

Below is a sample shell script for starting a Win32 program called emacs.exe, which is located in the /dev/fs/C/win32apps directory. Because the PATH variable is converted automatically, the script only converts HOME. When you develop your own scripts, you might need to convert more variables:

#!/bin/ksh
export HOME=$(posixpath2nt $HOME)
/dev/fs/C/win32apps/emacs.exe $*

You can use the #! notation at the top of a script to invoke a Win32 program that will interpret the script. For example, suppose that you had a bash script that you wanted to run using a Win32 port of the Bourne again shell (bash). If the bash shell were located at C:\winbin\bash.exe, you would type the following line at the top of your script:

#!/dev/fs/C/winbin/bash.exe

You must use an absolute path when calling a Win32 program with #! notation.

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.