The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 06-05-2008
robotball robotball is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 8
I found what is causing the bad file descriptor, however I do not know how to get the funcitonallity I want to work. I left a line out out of the f_print_log function as I was trying not to make my post to long. The function should be

function f_print_log
{
[[ $VERBOSE == 0 ]] && print $2
print -u$1 $2
return 0
}

So if I set the VERBOSE option in logtest.sh, output would be written to the screen and the file, however when f_open_log is called and it writes the "Log file open" using the f_print_log subroutine both the file descriptor and that line are sent back to logtest.sh which generates the bad descriptor.

Any suggestions. I would like to keep the Log file opened line if I can. Thanks.