I have a file, someFile, like this:
someFile
$cat someFile hdisk1 active hdisk2 active
I use this shell script to check:
Sometimes breaking the Perl enclosure is a good trick for these one-liners:
for d in 1 2 ; do cat kk2 | perl -lne ' print "'"${d}"': OK" if /hdisk'"${d}"'\s+/';done