>>>>> "Tony" == Anthony Carrico <acarrico@memebeam.com> writes:
Tony> Seems like an FAQ, but how do I run scsh in non-interactive mode?
Tony> Consider the following program:
Tony> #!/bin/bash
Tony> bash <<'bash'
Tony> echo bash hello world
Tony> bash
Tony> scsh <<'scheme'
Tony> (begin (display "scsh hello world") (newline))
Tony> scheme
Tony> The sub-bash knows that it is a non-interactive use, but the sub-scsh
Tony> doesn't so I get a bunch of junk:
Tony> bash hello world
Tony> Welcome to scsh 0.6.3 (Health Reform)
Tony> Type ,? for help.
>> scsh hello world
>>
Tony> Exit Scsh? (y/n)?
Tony> I'll only ask another 100 times.
Tony> Exit Scsh? (y/n)?
Tony> ...
The command ,batch does what you are looking for:
bash-2.03$ scsh <<'scheme'
> ,batch
> (begin (display "scsh hello world") (newline))
> scheme
Welcome to scsh 0.6.3 (Health Reform)
Type ,? for help.
> Will exit on errors
scsh hello world
bash-2.03$
Another option would be to use scsh's -sfd argument:
scsh -sfd 0 <<'scheme'
> (begin (display "scsh hello world") (newline))
> scheme
scsh hello world
which would avoid the "Will exit on errors" output, but I just
discovered that the implementation of -sfd is broken. I'll try to fix
this for 0.6.4.
--
Martin
|