批量安装perl-cpan库文件

前端之家收集整理的这篇文章主要介绍了批量安装perl-cpan库文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
#! /bin/bash #mv /root/cpan/MysqL-mmm-* /root pathname="/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DBD" cpanpath=/root/cpan echo "/usr/local/MysqL/lib/MysqL/" >> /etc/ld.so.conf ldconfig file1="DBD-MysqL-4.020.tar.gz" file2="perl-DBI-1.52-2.el5.i386.rpm" ls $cpanpath > /root/file while read i do         file3=$(rpm -qa perl-DBI |awk -F "1" '{print $1}')         if [ "$file3" != "perl-DBI-" ]         then                 rpm -ivh $cpanpath/$i                 sleep 2 #                mv /root/cpan/perl-DBI* /root         else                 if [ -d $pathname ]                 then                         tar xf $cpanpath/$i -C /tmp && cd /tmp/$(echo $i |awk -F ".tar" '{print $1}')                         perl Makefile.PL && make test && make install                         mv $cpanpath/$i /root                 else                         if [ "$i" = "$file1" ]                         then                                 tar xf $cpanpath/$i -C /tmp && cd /tmp/$(echo $i |awk -F ".tar" '{print $1}')                                 perl Makefile.PL --MysqL_config=/usr/local/MysqL/bin/MysqL_config --with-MysqL=/usr/local/MysqL && make test && make install  && mv $cpanpath/$i /root                                 continue                         fi                 fi         fi done < /root/file for j in `ls /root/cpan` do          tar xf $cpanpath/$j -C /tmp && cd /tmp/$(echo $j |awk -F ".tar" '{print $1}')          perl Makefile.PL && make test && make install          mv $cpanpath/$j /root done tar xf /root/MysqL-mmm* -C /tmp && cd /tmp/MysqL-mmm* && make install rm -rf /root/file

猜你在找的Perl相关文章