Mr. James W. Laferriere wrote:
Hello Doug , I thought sometime ago I'd mentioned the lack of support for device name(actuall filename) expansion in these tools . I am aware that a simple 'for do' loop would acomplish the same thing but that requires writing a script/function in order to do something that bash/ksh/.../??? has had available for quite sometime now . Would you please entertain the request to add the ability to use shell expansion of file expansion in the sg3 tools ?
Jim, sginfo is particularly difficult due to its syntax: sginfo [OPTIONS] [DEVICE] [REPLACEMENT_PARAMETERS] In the worst case it would be hard to distinguish between an additional DEVICE and the replacement parameters. As noted in its man page sginfo is a port of Eric Youngdale's scsiinfo utility. I regard sginfo as in legacy mode and suggest people use sdparm instead. And sdparm does what you want, its syntax is: sdparm [OPTIONS] DEVICE [DEVICE...] That was done in response to a request from you! Currently all the utilities in sg3_utils only support one device. In the sg3_utils/scripts directory are bash script examples, some of which do want you want. Even after cleaning up the option processing in sg3_utils with getopt_long() it only takes a small flourish to cause problems if multiple device names are allowed. For example, sg_start can be used to spin down a disk with either: sg_start --stop /dev/sdc sg_start 0 /dev/sdc Now the second invocation becomes ambiguous if multiple device names are allowed and there is a device name called "0" in the current directory. Some utilities are already dangerous, even when they look safe. Allowing multiple file names compounds the danger. For example, some SCSI commands are quite creative with their use of zero. If multiple devices were allowed, do not try this: sg_write_same --num=0 /dev/sd* Doug Gilbert -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html