Документ взят из кэша поисковой машины. Адрес оригинального документа : http://crydee.sai.msu.ru/ftproot/pub/comp/os/os2/xfree86os2/fixes_312D/startx.cmd
Дата изменения: Sun Mar 24 00:00:00 1996
Дата индексирования: Mon Dec 24 11:44:18 2007
Кодировка:
/* OS/2 REXX */
/* $XFree86: xc/programs/xinit/startx.cmd,v 3.1 1996/03/10 12:14:19 dawes Exp $
*
* This is just a sample implementation of a slightly less primitive
* interface than xinit. It looks for user xinitrc.cmd and xservrc.cmd
* files, then system xinitrc.cmd and xservrc.cmd files, else lets xinit choose
* its default. The system xinitrc should probably do things like check
* for Xresources files and merge them in, startup up a window manager,
* and pop a clock and serveral xterms.
*
* Site administrators are STRONGLY urged to write nicer versions.
*/
'@echo off'
ADDRESS CMD
env = 'OS2ENVIRONMENT'
x11root = VALUE('X11ROOT',,env)
IF x11root = '' THEN DO
SAY "The environment variable X11ROOT is not set. XFree86/OS2 won't run without it."
EXIT
END

home = VALUE('HOME',,env)
IF home = '' THEN home = x11root
os_shell = VALUE('X11SHELL',,env)
IF os_shell = '' THEN os_shell = VALUE('SHELL',,env)
IF os_shell = '' THEN os_shell = VALUE('OS2_SHELL',,env)
IF os_shell = '' THEN DO
SAY "There is no command interpreter in OS2_SHELL ???"
EXIT
END

userclientrc = home'\xinitrc.cmd'
userserverrc = home'\xservrc.cmd'
sysclientrc = x11root'\XFree86\lib\X11\xinit\xinitrc.cmd'
sysserverrc = x11root'\XFree86\lib\X11\xinit\xservrc.cmd'
clientargs = ''
serverargs = ''

IF exists(userclientrc) THEN
clientargs = userclientrc
ELSE
IF exists(sysclientrc) THEN
clientargs = sysclientrc

IF exists(userserverrc) THEN
serverargs = userserverrc
ELSE
IF exists(sysserverrc) THEN
serverargs = sysserverrc

whoseargs = "client"
PARSE ARG all

DO i=1 TO WORDS(all)
cur = WORD(all,i)
IF \(FILESPEC('DRIVE',cur) = '') THEN DO
IF whoseargs = "client" THEN
clientargs = cur
ELSE
serverargs = cur
END
ELSE
IF cur = "--" THEN
whoseargs = "server"
ELSE
IF whoseargs = "client" THEN
clientargs = clientargs' 'cur
ELSE
serverargs = serverargs' 'cur
END

'xinit 'os_shell' /c 'clientargs' -- 'serverargs

RETURN

exists:
'DIR "'arg(1)'" >nul 2>&1'
if rc = 0 THEN RETURN 1
RETURN 0