File: time

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (42 lines) | stat: -rw-r--r-- 749 bytes parent folder | download | duplicates (4)
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
# This will put the current time, date, etc according to your server
# in the approriate variables
alias servertime {
	stack push on 391
	^on ^391 * {
		@ day = [$2]
		@ month = [$3]
		@ date = [$4]
		@ time = [$7]
	}
	time
	wait
	stack pop on 391
}


# This will get the time from the uptime program and put it in the 
# variable uptime
on ^exec "uptime *" {
	@ uptime = [$1]
}
on ^exec_exit "uptime"
alias uptime {
	exec -name uptime uptime
	wait %uptime
}

# This will get the time, date, etc from the date program and
# put them in the appropriate variables.
on ^exec "date % % % *" {
	@ day = [$1]
	@ month  = [$2]
	@ date = [$3]
	@ time = [$4]
}
on ^exec_exit "date"
alias datetime {
	exec -name date date
	wait %date
}

#modernized by hop'95