From: Nala Ginrut <nalaginrut@gmail.com>
To: "Nelson H. F. Beebe" <beebe@math.utah.edu>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: [Proposal] Why not add a "shell" procedure?
Date: Sun, 13 May 2012 23:08:23 +0800 [thread overview]
Message-ID: <CAPjoZoe7hqu_pX4tqRmCMXvAnzeqZHzHf2H0q0d+G12z5=zMrA@mail.gmail.com> (raw)
In-Reply-To: <CMM.0.95.0.1336833443.beebe@psi.math.utah.edu>
On Sat, May 12, 2012 at 10:37 PM, Nelson H. F. Beebe
<beebe@math.utah.edu> wrote:
> Nala Ginrut <nalaginrut@gmail.com> 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: beebe@math.utah.edu -
> - 155 S 1400 E RM 233 beebe@acm.org beebe@computer.org -
> - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
> -------------------------------------------------------------------------------
>
next prev parent reply other threads:[~2012-05-13 15:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-12 14:37 [Proposal] Why not add a "shell" procedure? Nelson H. F. Beebe
2012-05-13 15:08 ` Nala Ginrut [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-12 12:30 Nala Ginrut
2012-05-12 12:35 ` Nala Ginrut
2012-05-12 14:22 ` Thien-Thi Nguyen
2012-05-13 15:04 ` Nala Ginrut
2012-05-13 18:29 ` Mark H Weaver
2012-05-14 0:17 ` Nala Ginrut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPjoZoe7hqu_pX4tqRmCMXvAnzeqZHzHf2H0q0d+G12z5=zMrA@mail.gmail.com' \
--to=nalaginrut@gmail.com \
--cc=beebe@math.utah.edu \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).