#pclose()
DESCRIPTION
close an open process, returning TRUE if successful, and ERR if unsuccessful
SYNOPSIS
#pclose(F)
ARGUMENTS
F - a filehandle (process handle) (all caps)
EXAMPLES
outputproc(C, P) // send all output from process (P) to communications
// channel (C)
// (C) is the comm channel (e.g., mail, syslog, print)
// (P) is the process (e.g., "=ll /tmp")
// sample use: =outputproc(mail, "=ll /tmp")
if #popen(OUTPUTPROC, (P), "r")
while #read(OUTPUTPROC) > 0
output (C) $rdlin
endwhile
do pclose(OUTPUTPROC)
fi
dutop(N, D) // using du, show the top N files/subdirs in directory D
// (N) is the number of displayed files/subdirs (e.g., 10)
// (D) is the directory (e.g., /tmp); don't enclose with quotes
output mail =newline
if "(D)" eq "/"
do #popen(DU, "=dusk /\* | =sort +0nr | =head -n (N)", "r")
else
do #popen(DU, "=dusk (D)/\* | =sort +0nr | =head -n (N)", "r")
endif
while #read(DU) > 0
output mail $readline
endwhile
do pclose(DU)
output mail =newline
SEE ALSO
#fopen()
#fclose()
#popen()
#read()
#write()
Numerical Functions
String Functions