Skip to content

Instantly share code, notes, and snippets.

@ogredude
Created April 10, 2012 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ogredude/2353567 to your computer and use it in GitHub Desktop.
Save ogredude/2353567 to your computer and use it in GitHub Desktop.
./automysqlbackup/automysqlbackup: line 835: 6: Bad file descriptor
./automysqlbackup/automysqlbackup: line 836: 7: Bad file descriptor
# @info: Restore stdout and stderr redirections.
# @deps: (none)
removeIO() {
exec 1>&6 6>&- # Restore stdout and close file descriptor #6.
exec 2>&7 7>&- # Restore stdout and close file descriptor #7.
}
@Sebbo94BY
Copy link

This issue can be fixed by using the correct syntax:

# @info:        Restore stdout and stderr redirections.
# @deps:        (none)
removeIO() {
  exec 1<&6 6>&-      # Restore stdout and close file descriptor #6.
  exec 2<&7 7>&-      # Restore stdout and close file descriptor #7.
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment