]> granicus.if.org Git - zfs/commit
Fix zed io-spare.sh dash incompatibility
authorChris Dunlap <cdunlap@llnl.gov>
Thu, 11 Sep 2014 22:41:35 +0000 (15:41 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 23 Sep 2014 22:32:30 +0000 (15:32 -0700)
commitbee6665b88fca3b5e70e8b3c8f6281975721c7be
tree85581fb4178c44741bb73548166795b7b4427eae
parent36283ca23346061cb653dc7b6bd583d1cf772808
Fix zed io-spare.sh dash incompatibility

The zed's io-spare.sh script defines a vdev_status() function to query
the 'zpool status' output for obtaining the status of a specified vdev.
This function contains a small awk script that uses a parameter
expansion (${parameter/pattern/string}) supported in bash but not
in dash.  Under dash, this fails with a "Bad substitution" error.

This commit replaces the awk script with a (hopefully more portable)
sed script that has been tested under both bash and dash.

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2536
cmd/zed/zed.d/io-spare.sh