in reply to How to run a shell script from a Perl program?
I like to do this sometimes ...
... to capture the stdout of the shell commands in a scalar var.my $shell_out = <<`SHELL`; for fs in `/sbin/fdisk -l | grep -v swap | grep Linux | cut -d ' ' -f1 +` do /sbin/e2label \$fs | grep recovery > /dev/null 2>&1 && echo "Y +ES" && exit 0 done echo "NO" exit 0 SHELL
|
---|
In Section
Seekers of Perl Wisdom