home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $Id: command.rexx,v 1.1 1995/02/12 22:14:00 rkr Exp $
- **
- ** Execute an AmigaDOS command and return the output.
- **
- ** CAREFUL: If a command does NOT return any output, this script WILL lock
- ** up!
- **
- */
- parse arg cmd
- ret = ''
- pipe_file = 'pipe:command.'pragma( 'i' )
- if open( pipe_file, pipe_file, 'r' ) then
- do
- address command cmd '>'pipe_file
- do while ~eof( pipe_file )
- ret = ret || readch( pipe_file, 4096 )
- end
- call close( pipe_file )
- end
- return ret
-