File: pipe

package info (click to toggle)
epic4 1%3A2.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,600 kB
  • ctags: 5,377
  • sloc: ansic: 55,723; makefile: 656; sh: 158; perl: 30
file content (24 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Ok.  Here's the plan.
 *
 * $pipe(commands) will return the output from 'commands'.
 */

alias pipe {
	@ pipe.intval++
	^local mypipeval $pipe.intval
	^local mypipedesc pipe$mypipeval
	^local mypiperetval

	^on ^exec "$mypipedesc *" {
		bless
		push mypiperetval $1-
	}

	^exec -name $mypipedesc $*
	^wait %$mypipedesc
	^on exec -"$mypipedesc *"
	return $mypiperetval
}

#hop'97