Mike Mestnik <che...@mikemestnik.net> writes: > This does look better, I love the use of operators over if statements. > I don't think using a temp file is necessary here. I also wish the > regex wouldn't ever match a device containing the name of another > device, in that it should match the surrounding bits. > > { dmraid -r -c 2>/dev/null || true } | grep -q "$device" && return 0
The use of the temporary file is there to stop the repeated running of dmraid, which was the sole purpose of the commit that introduced the bug, so if one gets rid of that one might as well just revert that commit. I agree that there appears to be the potential for $device to match inappropriately, but I'd need to know something about what dmraid outputs in order to improve on the grep (I don't have a sataraid machine to test it on). Adding a -F option might be a good start. Cheers, Phil. -- |)| Philip Hands [+44 (0)20 8530 9560] HANDS.COM Ltd. |-| http://www.hands.com/ http://ftp.uk.debian.org/ |(| Hugo-Klemm-Strasse 34, 21075 Hamburg, GERMANY
signature.asc
Description: PGP signature