#!/usr/bin/env perl # Workaround for the tcsh exec bug. Example: # tcsh> exec shexec zsh use strict; eval { require POSIX; foreach (3..63) { POSIX::close $_ if -t $_ } 1; } or warn <<"EOF"; Perl POSIX module not found! The non-standard file descriptors attached to a tty (as those let open by this buggy tcsh) could not be closed. EOF # Note: the LC_ALL environment variable could have been set just before # the call to this shexec Perl script, in order to avoid a perl warning # about non-supported locales (locale settings may come from SSH and may # be fixed by an init script of the shell that is going to be executed). # So, assume that LC_ALL should not be set, and unset it explicitly. exec qw/env -u LC_ALL/, @ARGV; # $Id: shexec 42228 2011-02-25 12:23:03Z vinc17/ypig $