mikef@borg.lerc.nasa.gov (Mike J. Fuller) (06/25/91)
Just in case anyone is interested, the following Perl script which I use to start AMD fails to work correctly under Irix 3.3.2: #! /usr/local/bin/perl $amd = "/usr/local/etc/amd"; $master = "amd.master"; open (YPCAT, "ypcat -k $master |") || die "Cannot open pipe from ypcat.\n"; $args = "-p -r -a /tmp_mnt -l syslog"; while (<YPCAT>) { chop; split; if ( -d "$_[0]" || ("$_[2]" !~ /direct/)) { $args = "$args $_"; } } close(YPCAT); exec "$amd $args > /etc/amd.pid"; die "Failed to exec amd.\n"; The -d "$_[0]" always evaluates true, causing every directory in the map to be automounted. I tried a simple Perl script like: if ( -d "/tmp/foo" ) { print "Foo.\n"; } and it worked correctly for the cases when "/tmp/foo" didn't exist, was a directory, and was a plain file. Since I am used to the Mips compilers being Buggs Bunny, I recompiled Perl with GCC and it now works correctly. Incidently, if you want to compile Perl with GCC under Irix 3.3.2, the first line of perly.c which reads: extern char *malloc(), *realloc(); will have to be changed to: extern void *malloc(), *realloc(); or commented out after the YACC run. /-----------------------------------------------------------------------------\ | Mike J. Fuller | Internet: mikef@sarah.lerc.nasa.gov | "I hate | |----------------| mikef@zippysun.math.uakron.edu | quotations." | |/\/\/\/\/\/\/\/\| Bitnet: r3mjf1@akronvm | -- R.W. Emerson | \-----------------------------------------------------------------------------/