mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
80e0c41b89
The default bash setting have nullglob disabled so if $SCSI_DEV/scsi_generic* aka /sys/bus/scsi/devices/*:*:*:*/scsi_generic* does not match anything, it leaves the glob pattern unmodified and SG_DEV=$(basename $SG_DEV/*) results in the literal: * If $SG_INQ exists, it invoked sg_inq with more than the one allowed positional argument for a SCSI generic device node: sg_inq /dev/* Causing error messages and the usage of sg_inq to land in $TAPE_SERIAL. To not have to rely on the nullglob setting, explicitly check for the existence of $SCSI_DEV/scsi_generic before evaluating SG_DEV=$(basename $SG_DEV/*). Also handle availability of sg_inq but absence of scsi_generic individually to provide the user with a hint if only sg is missing. Suggested-by: Eric Farman <farman@linux.vnet.ibm.com> Signed-off-by: Steffen Maier <maier@linux.ibm.com> Reviewed-by: Jens Remus <jremus@linux.ibm.com> Cc: Eric Farman <farman@linux.vnet.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>