2 Copyright
2003-2004 The Apache Software Foundation
4 Licensed under the Apache License
, Version
2.0 (the
"License");
5 you may
not use this file except in compliance with the License.
6 You may obtain a
copy of the License at
8 http
://www.apache.org
/licenses
/LICENSE
-2.0
10 Unless required by applicable law or agreed to in writing
, software
11 distributed under the License is distributed on an
"AS IS" BASIS
,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND
, either express or implied.
13 See the License
for the specific language governing permissions and
14 limitations under the License.
16 Run RC file
, name is in the first arg
, second arg is either
PATH
20 parse arg name
path rest
23 say 'RC file name is missing'
28 say 'Too many parameters'
36 parse arg name
path dir
38 if path \
= '' & path \
= '-r' then do
39 dir = value
(translate
(path),,'OS2ENVIRONMENT')
40 if dir = '' then return
41 dir = translate
(dir, '\', '/') /* change UNIX-like path to OS/2 */
44 if dir = '' then dir = directory()
46 if path = '-r
' then do /* recursive call */
47 subdir = filespec('path', dir)
48 if subdir \= '\' then do
49 subdir
= left
(subdir
, length
(subdir
)-1)
50 call runit name
path filespec
('drive', dir) || subdir
54 /* Look
for the file and
run it
*/
55 if right
(dir, 1) \
= '\' then dir = dir || '\'
56 rcfile
= stream
(dir || name
, 'c', 'query exists')
57 if rcfile \
= '' then interpret
'call "' || rcfile ||
'"'