On 2011-01-26 21:53, Nick Sabalausky wrote:
"Jacob Carlborg"<[email protected]>  wrote in message
news:[email protected]...
On 2011-01-26 14:58, Steven Schveighoffer wrote:
On Wed, 26 Jan 2011 03:36:24 -0500, Jacob Carlborg<[email protected]>  wrote:

I typically find /bin/sh features to be enough for implementing most
scripts.

I have no idea. I need to be able use the following commands/functions:

export, source, builtin hash, rm, echo, exit, exec


Can't all (or most) of that be done in straight D?

It all comes done to one thing, the "source" function. If you launch an application in a shell that application can't set environment variables that will be available to the shell when the application exits.

So instead I have most of the application written in D with a bash function that wraps the application. It works like this:

1. The function calls the D application
2. The D application performs all it needs to and writes a shell script to a file
3. The bash function calls "source" with this file as a parameter


--
/Jacob Carlborg

Reply via email to