A bad thing about ALFS in c

Felipe Contreras al593181 at mail.mty.itesm.mx
Tue Nov 6 09:03:14 PST 2001

On Mon, Nov 05, 2001 at 02:25:30PM -0500, Jason Gurtz wrote:

> > [...] I found a really bad thing about interacting with bash.
> > Basically you can say to bash to execute commands in very different
> > ways, some nicer than others, but the point is that you can't never
> > know the status of some command, you can know the status of the
> > whole shell but not where it failed or anything.
> 	Hmm, I thought you could check in the middle for the value of $?
> 	to get exit codes?

You need a coshell, you need to add some shell code after each command,
and output it to a file descriptor so the c program can retrieve the
code using pipes.

<COMMAND>; echo "$?" > /dev/fd/15

I'm sure it can be done, but it's hard, and I just don't feel it's the
right way to do it. It's a little of bash scripting anyway, and if we
are going to use bash scripting why not do someting good, might be a
special interaction between c and bash code, that's what I'm thinking
about right now (for my project).

Felipe Contreras
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe alfs-discuss' in the subject header of the message

More information about the alfs-discuss mailing list