Article View: news.software.readers
Article #36438Re: slrn macros: running other commands
From: John E. Davis
Date: Sat, 04 Oct 1997 00:00
Date: Sat, 04 Oct 1997 00:00
22 lines
1332 bytes
1332 bytes
On 4 Oct 1997 08:34:54 GMT, John R MacMillan <john@mail.interlog.com> wrote: >expires a week from today. If I have the date string, I pre-load the >input and call "create_score". I can get the date string via GNU >date. But how can I run GNU date and capture the output? The current version of slang has no support for reading from a pipe, so you would have to use the `system' function to call `date' and send its output to a file. Then read the file using the appropriate slang intrinsics, e.g., fopen, fgets, and fclose. An alternative is to use the built-in `time' intrinsic function. It returns a string of the form: "Sat Oct 4 11:50:55 1997" Then you can extract the fields with other slang intrinsics. --John
Technical Details
Message-ID:
<slrn63cpu4.ub5.davis@mygir.davis.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<slrn63bvu2.2qt.john@elixir.interlog.com>Show Full Headers
Complete Article Headers
Message-ID: <slrn63cpu4.ub5.davis@mygir.davis.net> Subject: Re: slrn macros: running other commands Date: Sat, 04 Oct 1997 00:00:00 +0000 From: davis@space.mit.edu (John E. Davis) References: <slrn63bvu2.2qt.john@elixir.interlog.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 278200063 Organization: Center for Space Research Newsgroups: news.software.readers