Hi,

I though I remember long time ago some trick that would allow a script
to redirect its stdin/stdout from/to a file without having to enclose
the entire script inside a sub-shell.

I mean, something like:

#!/bin/sh

(command;
command;
...
..) < /dev/null > output 2>&1

Would work, but I think that I saw something to achieve the same in a
more elegant way.

Does anyone know what I'm talking about?

As a secondary question - for this specific script, it's important for
me to actually close its standard input so when some of the commands
get executed they'll know that they have nothing to wait on from the
keyboard. Right now I just redirect it from /dev/null from the command
line which executes the script but was wondering if there is a way to
say "close fd 0" in shell inside the script itself.

The environment is CentOS 5, but I like portable solutions.

Thanks.

--Amos

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to