Hello Monks
I'm working on linux and writing a perl script which checks for some packages on it. If packages are not found, i need to install them. here is what i've tried so far...
#!/usr/bin/perl use strict; open( RPM, "rpm -qa |"); my @rpms = <RPM>; chomp(@rpms); close RPM; # Remove the duplicate values @rpms = keys %{{ map { $_ => 1 } @rpms }}; my @glibc_rpm = grep(/glibc/, @rpms); if ( @glibc_rpm ) { print "package found"; } else { # Install the package my $retCode = qx'yum install glibc-common-2.5-49'; }
In reply to yum in perl by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |