Duane:
>but I am at a lost with "... 2>&1 <<MSG "
>- I don't fully understand what's happening -and- "MSG" >is a mystery to me. also, what do you mean when you >say "using the Unix "here" document" (specifically >by "here"
1) 2>&1 redirects file hand 2 which is standard error to standard input, file handle 1. In this case, right before 2>&1 standard input is redirected to /dev/null. Remove the redirections for file handle 1 and 2 and you can see the output.
2) Instead of getting input from the keyboard or redirecting input from a file, you can embed input inline in a script using << and some arbitrary word. The here document terminates with the same arbitrary word. It's important that the ending word exist and be in column 1.
A simple example:
Instead of echo'ing lines of text:
echo "line 1"
echo "line 2"
echo "line 3"
use a "here document:
cat << MSG
line 1
line 2
line 3
MSG
I'm told it's called a "here" document, because you get the input "here" vs. from over "there" i.e. a keyboard or file.
My example uses the "here" document to provide the input instead of a user entering the same keystrokes from the keyboard. You can do this with nearly any unix command.
Let me know if you have any other questions.
Regards,
Ed