File: get-sys.2gg

package info (click to toggle)
golf 601.4.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: ansic: 20,020; sh: 1,171; makefile: 292
file content (75 lines) | stat: -rw-r--r-- 1,829 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.TH GOLF 2gg $VERSION $DATE Development Tools
.SH NAME
get-sys \-  (system-information)
.SH PURPOSE
Obtain data that describes the system.

.SH SYNTAX

.RS 4
.EX

get-sys \\
    environment <var name> \\
        directory | os-name | os-version \\
    to <variable>

.EE
.RE

.SH DESCRIPTION
System-describing variables can be obtained with get-sys statement and the result stored into <variable>. The following system variables can be obtained:

.RS 4
\[bu]    
"environment" returns the name of a given environment variable <var name>. If this is a server program, then the environment passed from a remote caller (such as web proxy) is queried. If this is a \fBcommand-line\fP program, then the environment from the Operating System is queried. In the following example,the QUERY_STRING variable (i.e. the actual query string from URL) is obtained:

.RS 4
.EX

get-sys environment "QUERY_STRING" to qstr

.EE
.RE



.RE

.RS 4
\[bu]    
"directory" is the execution directory of the \fBcommand-line\fP program, i.e. the current working directory when the program was executed. Note that Golf will change the current working directory immediately afterwards to the application home directory (see \fBdirectories\fP). You can use this clause to work with files in the directory where the program was started. If your program runs as a \fBservice\fP, then "directory" clause always returns application home directory, regardless of which directory \fBmgrg\fP program manager started your application from.


.RE

.RS 4
\[bu]    
"os-name" is the name of Operating System.


.RE

.RS 4
\[bu]    
"os-version" is the version of Operating System.
.RE


.SH EXAMPLES
Get the name of the Operating System

.RS 4
.EX

get-sys os-name to os_name

.EE
.RE

.SH SEE ALSO
 System information

\fBget-sys\fP   
See all 
\fBdocumentation\fP