home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!gmd.de!borneo.gmd.de!richard
- From: richard@borneo.gmd.de (Richard Czech)
- Newsgroups: comp.lang.tcl
- Subject: Re: exec output file format (can't say exec foo > stdout)
- Message-ID: <1992Aug27.104816.29283@gmd.de>
- Date: 27 Aug 92 10:48:16 GMT
- References: <1992Aug26.211548.22311@osf.org>
- Sender: news@gmd.de (USENET News)
- Reply-To: richard@borneo.gmd.de
- Organization: GMD, German National Research Center for Computer Science
- Lines: 23
- Nntp-Posting-Host: hawaii
-
- In article <1992Aug26.211548.22311@osf.org>, pnh@pmin24.osf.org (Peter Harbo)
- writes:
- |> I recently wanted to use the exec command to send the output of a UNIX
- |> command
- |> directly to standard output rather than returned as a TCL result like so
- |>
- |> exec date > stdout
- |>
- |> using the "stdout" filename. Unfortunately exec does not work like "puts"
- |> which calls TclGetOpenFile() to translate "stdout" to a file descriptor,
- |> instead it apparently calls Tcl_CreatePipeline() to open the file following
- |> '>' via open(), ergo no translation.
-
- Try this:
-
- puts stdout [exec date]
-
- ----------------------------------------------------------------------
- Richard Czech e-mail: czech@gmd.de
- GMD-I5-FIT
- P.O.Box 13 16 phone: (+49) 2241 14 2039
- D-5205 St. Augustin 1, Germany fax: (+49) 2241 14 2342
- ----------------------------------------------------------------------
-