SH Command

Currently, at work there is a script that has the following command :

sh ${__ENGINE} 1>&2

now, the issue is with the sh before The question is how does this work with placing the call ( in the "background" so to say. Most of the programmers at work use the & to background a script when it is called from another script and using SH has started a debate along with some confusion.
What I am looking for is a clear definition of what the SH does in this instance.


It just specifies that the following file ( should be processed using the 'sh' shell.
It has nothing to do with placing the command in the background. The '1>&2' that you mention is specifying that the STDOUT (output stream 1) should be redirected to the wherever STDERR (output stream 2) is going (usually your screen).

You would do something like:

sh ${__ENGINE} 1>&2 &

to put it in the background

One other difference is that "sh" does not
require to be executable (i.e. it can have
file permissions 644 rather than 755). This book might help.

<B>Unix Shell Programming (Hayden Books Unix System Library) <BR>
by Stephen G. Kochan, Patrick H. Wood (Contributor)

<A HREF=""><IMG SRC="" border=0></a>

This was Neo's first text for UNIX shell scripts. This is a great book and highly recommended. If you click on the photo, it will take you to for more details.

[Edited by Neo on 11-03-2000 at 09:32 PM]