[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Proposal] Why not add a "shell" procedure?
From: |
Nelson H. F. Beebe |
Subject: |
Re: [Proposal] Why not add a "shell" procedure? |
Date: |
Sat, 12 May 2012 08:37:23 -0600 (MDT) |
Nala Ginrut <address@hidden> writes today about adding a
function to return a string from a command executed by a shell,
because (system "...") only returns the exit status of the last
command.
The one point that I think is important is the handling of whitespace.
The Unix shells in their backquoted `cmd` and $(cmd) syntax normalize
the output of cmd to replace runs of whitespace [ \n\r\v\t]+ by single
spaces.
For shell use, that is convenient. However, inside guile, it may be
more useful to preserve the whitespace as is, and particularly the
line breaks.
A user who wants whitespace collapsed to single spaces can easily do
so with a regexp substitution, and that could be facilitated by
providing a standard guile library function to do the job
consistently.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: address@hidden -
- 155 S 1400 E RM 233 address@hidden address@hidden -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------