shell programming challenge
afabian at austin.rr.com
Fri Nov 26 09:08:06 PST 2004
On Fri, Nov 26, 2004 at 09:15:11AM -0700, Don Wilde wrote:
> >If you have the option to modify it, ensure that your script exits via
> >"exec sh". Alternatively a wrapper that does this is straightforward to
> It's looking more and more that I need to make a temporary file that
> packages both the init file and the program command line (eval
> "blah...") before running. These will not be just shell scripts, they
> will be tool programs and x applications. Didn't want to do that because
> of the risk of leaving junk in /tmp.
It's really socially-acceptable to leave junk in /tmp. /tmp is a
volatile dumping ground with no guarantee of file suvival for any
length of time, that may even be cleaned on reboot.
I played with this for a while, and I have a suspicion that maybe you
could use /dev/fd/3 and start bash with something like --rc-file
/dev/fd/3 and not close tha standard input, but it's not possible, or
I couldn't quite pull it off. (I suspect the latter.)
The only other option I can think of involves a temporary file of
sorts, too. You could use a FIFO, and then the contents of the
"temporary file" wouldn't be left on the disk, but you'd still have
the FIFO to deal with.
You may also be trying to do something complex enough that it's just
more trouble than it's worth to do it with shell programming.
Anyway, good luck.
Adam Fabian (afabian at austin.rr.com)
More information about the freebsd-questions