I have a file, someFile
, like this:
$cat someFile
hdisk1 active
hdisk2 active
I use this shell script to check:
You can enable rudimentary command line argument with the "s" switch. A variable gets defined for each argument starting with a dash. The --
tells where your command line arguments start.
for d in 1 2 ; do
cat someFile | perl -slane ' print "$someParameter: OK" if /hdisk$someParameter\s+/' -- -someParameter=$d;
done
See: perlrun