The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-18-2007
rfourn rfourn is offline
Registered User
 

Join Date: Jun 2007
Posts: 4
Help with exec command and file descriptors??

im having trouble with the comprehending the exec command and the use of file descriptors.
given:

#!/bin/sh

exec 4>&1
exec 1>&2
exec 2>&4
exec 4>&-

echo Hello

would the standard output of this script be sent to STDOUT, STDERR or neither and why???

thanks for the help.
Forum Sponsor