The problem is that expect doesn't seem to be sending the password to su. I know this really a Perl question but I was hoping some of you nice monks might be able to help me?#!/bin/sh for i in \ perl_mod1 \ perl_mod2 \ perl_mod3 do echo "do $i ?" read doit if [ $doit = 'y' ] then rm -rf $i tar -xvf ${i}.tar cd $i perl Makefile.PL echo "perl makefile.pl okay?" read key make echo "make okay?" read key make test echo "make test okay?" read key # su root -c "/usr/local/bin/make install" expect -c 'spawn su root -c "/usr/local/bin/make insta +ll" send -- "rootspasswd\r" ' echo "make install okay?" read key cd .. else echo "okay f it" fi done
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |