[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Proposal] Why not add a "shell" procedure?
From: |
Nala Ginrut |
Subject: |
Re: [Proposal] Why not add a "shell" procedure? |
Date: |
Sun, 13 May 2012 23:08:23 +0800 |
On Sat, May 12, 2012 at 10:37 PM, Nelson H. F. Beebe
<address@hidden> wrote:
> 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.
>
Yes, I don't think we should handle whitespace for users either. And
the "shell" in Ruby dosen't too.
I think my implementation reflects this.
> 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.
>
well, this could be interesting.
Anyway, I think we should have an inner way to run shell first.
> -------------------------------------------------------------------------------
> - 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/
> -
> -------------------------------------------------------------------------------
>