sg_vpd: pwr_d_s (spl3r3); scripts directory gets Makefile.am

git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@495 6180dd3e-e324-4e3e-922d-17de1ae2f315
diff --git a/ChangeLog b/ChangeLog
index 4b52df8..a54fa0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,9 +2,10 @@
 some description at the top of its ".c" file. All utilities in the main
 directory have their own "man" pages. There is also a sg3_utils man page.
 
-Changelog for sg3_utils-1.36 [20130508] [svn: r494]
-  - sg_vpd: Protocol-specific port information VPD page for
-    SAS SSP, persistent connection (spl3r2)
+Changelog for sg3_utils-1.36 [20130513] [svn: r495]
+  - sg_vpd: Protocol-specific port information VPD page
+    for SAS SSP, persistent connection (spl3r2), power
+    disable (spl3r3)
   - sg_xcopy: handle more descriptor types; handle zero
     maximum segment length; allow list IDs to be disabled;
     improve skip/seek handling; allow xcopy on destination
diff --git a/Makefile.am b/Makefile.am
index 6f0b63c..0417ee9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,8 @@
 SUBDIRS = include \
 	  lib \
 	  src \
-	  doc
+	  doc \
+	  scripts
 
 EXTRA_DIST=autogen.sh COVERAGE CREDITS
 
diff --git a/Makefile.in b/Makefile.in
index ab1b2a8..1054b6b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -247,7 +247,8 @@
 SUBDIRS = include \
 	  lib \
 	  src \
-	  doc
+	  doc \
+	  scripts
 
 EXTRA_DIST = autogen.sh COVERAGE CREDITS
 all: config.h
diff --git a/aclocal.m4 b/aclocal.m4
index 9f6baea..da85b1d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1338,7 +1338,14 @@
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
 	    ;;
 	  ppc64-*linux*|powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
@@ -1702,7 +1709,8 @@
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -2526,17 +2534,6 @@
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -2653,7 +2650,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -3269,10 +3266,6 @@
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -3311,7 +3304,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -4063,7 +4056,7 @@
 	    ;;
 	esac
 	;;
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
@@ -4362,7 +4355,7 @@
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -6251,9 +6244,6 @@
         _LT_TAGVAR(ld_shlibs, $1)=yes
         ;;
 
-      gnu*)
-        ;;
-
       haiku*)
         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -6415,7 +6405,7 @@
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
 
-      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
         case $cc_basename in
           KCC*)
 	    # Kuck and Associates, Inc. (KAI) C++ Compiler
diff --git a/build_debian.sh b/build_debian.sh
index ac5a0bf..72dcfff 100755
--- a/build_debian.sh
+++ b/build_debian.sh
@@ -8,8 +8,8 @@
 
 # in some environments the '-rfakeroot' can cause a failure (e.g. when
 # building as root). If so, remove that argument from the following:
-echo "dpkg-buildpackage -b -rfakeroot"
-dpkg-buildpackage -b -rfakeroot
+echo "dpkg-buildpackage -b -rfakeroot -us -uc"
+dpkg-buildpackage -b -rfakeroot -us -uc
 
 # If the above succeeds then the ".deb" binary package is placed in the
 # parent directory.
diff --git a/configure b/configure
index 7c871dd..d3348e8 100755
--- a/configure
+++ b/configure
@@ -4531,7 +4531,8 @@
     ;;
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+	test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
@@ -4932,10 +4933,6 @@
   fi
   ;;
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 haiku*)
   lt_cv_deplibs_check_method=pass_all
   ;;
@@ -4974,7 +4971,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
@@ -6072,7 +6069,14 @@
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
 	  x86_64-*linux*)
-	    LD="${LD-ld} -m elf_i386"
+	    case `/usr/bin/file conftest.o` in
+	      *x86-64*)
+		LD="${LD-ld} -m elf32_x86_64"
+		;;
+	      *)
+		LD="${LD-ld} -m elf_i386"
+		;;
+	    esac
 	    ;;
 	  ppc64-*linux*|powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
@@ -7897,7 +7901,7 @@
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
       # old Intel for x86_64 which still supported -KPIC.
       ecc*)
@@ -10067,17 +10071,6 @@
   esac
   ;;
 
-gnu*)
-  version_type=linux # correct to gnu/linux during the next big refactor
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
 haiku*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
@@ -10194,7 +10187,7 @@
   ;;
 
 # This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
@@ -11573,7 +11566,7 @@
 fi
 
 
-ac_config_files="$ac_config_files Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile"
+ac_config_files="$ac_config_files Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -12605,6 +12598,7 @@
     "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+    "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/configure.ac b/configure.ac
index 7171413..5f50fa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -81,4 +81,4 @@
 		  [Disable full SCSI sense strings])],
   [], [AC_DEFINE_UNQUOTED(SG_SCSI_STRINGS, 1, [full SCSI sense strings], )])
 
-AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile)
+AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile)
diff --git a/debian/rules b/debian/rules
index fa5cfe4..d3a2b0c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,7 +49,6 @@
 	$(MAKE) -e install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
 
 	dh_install --autodest --sourcedir=debian/tmp
-	cp scripts/scsi* debian/sg3-utils/usr/bin
 
 	dh_installman
 
diff --git a/doc/scsi_logging_level.8 b/doc/scsi_logging_level.8
index 0a3a6fe..b6d33c0 100644
--- a/doc/scsi_logging_level.8
+++ b/doc/scsi_logging_level.8
@@ -1,4 +1,4 @@
-.TH SCSI_LOGGING_LEVEL "8" "December 2011" "sg3_utils\-1.33" SG3_UTILS
+.TH SCSI_LOGGING_LEVEL "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_logging_level \- access Linux SCSI logging level information
 .SH SYNOPSIS
@@ -12,7 +12,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script accesses the Linux SCSI subsystem logging
+This bash shell script accesses the Linux SCSI subsystem logging
 level. The current values can be shown (e.g. with \fI\-\-get\fR)
 or changed (e.g. with \fI\-\-set\fR). Superuser permissions will
 typically be required to set the logging level.
diff --git a/doc/scsi_mandat.8 b/doc/scsi_mandat.8
index 70469f6..7606861 100644
--- a/doc/scsi_mandat.8
+++ b/doc/scsi_mandat.8
@@ -1,4 +1,4 @@
-.TH SCSI_MANDAT "8" "December 2011" "sg3_utils\-1.33" SG3_UTILS
+.TH SCSI_MANDAT "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_mandat \- check SCSI device support for mandatory commands
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls several SCSI commands on the given
+This bash shell script calls several SCSI commands on the given
 \fIDEVICE\fR. These SCSI commands are considered mandatory (although
 that varies a little depending on which standard/draft the \fIDEVICE\fR
 complies with). The results of each test and a pass/fail count are
@@ -36,7 +36,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2011 Douglas Gilbert
+Copyright \(co 2011\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/scsi_readcap.8 b/doc/scsi_readcap.8
index 0e7dd3f..40532b0 100644
--- a/doc/scsi_readcap.8
+++ b/doc/scsi_readcap.8
@@ -1,4 +1,4 @@
-.TH SCSI_READCAP "8" "October 2009" "sg3_utils\-1.28" SG3_UTILS
+.TH SCSI_READCAP "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_readcap \- do SCSI READ CAPACITY command on disks
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls the sg_readcap utility on each given
+This bash shell script calls the sg_readcap utility on each given
 \fIDEVICE\fR. This will send a SCSI READ CAPACITY command to each
 \fIDEVICE\fR.
 .PP
@@ -43,7 +43,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2009 Douglas Gilbert
+Copyright \(co 2009\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/scsi_ready.8 b/doc/scsi_ready.8
index 21eb7ca..50a6ed7 100644
--- a/doc/scsi_ready.8
+++ b/doc/scsi_ready.8
@@ -1,4 +1,4 @@
-.TH SCSI_READY "8" "October 2009" "sg3_utils\-1.28" SG3_UTILS
+.TH SCSI_READY "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_ready \- do SCSI TEST UNIT READY on devices
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls the sg_turs utility on each given
+This bash shell script calls the sg_turs utility on each given
 \fIDEVICE\fR. This will send a SCSI TEST UNIT READY command to each
 \fIDEVICE\fR. Disks, tape drives and DVD/BD players amongst others
 may respond to this SCSI command.
@@ -32,7 +32,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2009 Douglas Gilbert
+Copyright \(co 2009\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/scsi_satl.8 b/doc/scsi_satl.8
index 57cd7f6..da6c43a 100644
--- a/doc/scsi_satl.8
+++ b/doc/scsi_satl.8
@@ -1,4 +1,4 @@
-.TH SCSI_SATL "8" "December 2011" "sg3_utils\-1.33" SG3_UTILS
+.TH SCSI_SATL "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_satl \- check SCSI to ATA Translation (SAT) device support
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls several SCSI commands on the given
+This bash shell script calls several SCSI commands on the given
 \fIDEVICE\fR that is assumed to be an ATA device behind a SCSI
 to ATA Translation (SAT) layer (SATL). The results of each test
 and a pass/fail count are output.
@@ -35,7 +35,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2011 Douglas Gilbert
+Copyright \(co 2011\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/scsi_start.8 b/doc/scsi_start.8
index 694d4bb..f98985b 100644
--- a/doc/scsi_start.8
+++ b/doc/scsi_start.8
@@ -1,4 +1,4 @@
-.TH SCSI_START "8" "August 2009" "sg3_utils\-1.28" SG3_UTILS
+.TH SCSI_START "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_start \- start one or more SCSI disks
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls the sg_start utility on each given
+This bash shell script calls the sg_start utility on each given
 \fIDEVICE\fR. The purpose is to spin up (start) each given \fIDEVICE\fR.
 .SH OPTIONS
 Arguments to long options are mandatory for short options as well.
@@ -32,7 +32,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2009 Douglas Gilbert
+Copyright \(co 2009\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/scsi_stop.8 b/doc/scsi_stop.8
index 6374194..488c7cf 100644
--- a/doc/scsi_stop.8
+++ b/doc/scsi_stop.8
@@ -1,4 +1,4 @@
-.TH SCSI_STOP "8" "August 2009" "sg3_utils\-1.28" SG3_UTILS
+.TH SCSI_STOP "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_stop \- stop (spin down) one or more SCSI disks
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls the sg_start utility on each given
+This bash shell script calls the sg_start utility on each given
 \fIDEVICE\fR. The purpose is to spin down (stop) each given \fIDEVICE\fR.
 .SH OPTIONS
 Arguments to long options are mandatory for short options as well.
@@ -33,7 +33,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2009 Douglas Gilbert
+Copyright \(co 2009\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/scsi_temperature.8 b/doc/scsi_temperature.8
index 30b1ddd..e9ff181 100644
--- a/doc/scsi_temperature.8
+++ b/doc/scsi_temperature.8
@@ -1,4 +1,4 @@
-.TH SCSI_TEMPERATURE "8" "December 2011" "sg3_utils\-1.33" SG3_UTILS
+.TH SCSI_TEMPERATURE "8" "May 2011" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 scsi_temperature \- fetch the temperature of a SCSI device
 .SH SYNOPSIS
@@ -8,7 +8,7 @@
 .SH DESCRIPTION
 .\" Add any additional description here
 .PP
-This Bourne shell script calls the sg_logs utility on each given
+This bash shell script calls the sg_logs utility on each given
 \fIDEVICE\fR in order to find the device's temperature. The Temperature
 log page is checked first and if it is not available then the Informational
 Exceptions log page is checked.
@@ -27,7 +27,7 @@
 .SH AUTHORS
 Written by D. Gilbert
 .SH COPYRIGHT
-Copyright \(co 2011 Douglas Gilbert
+Copyright \(co 2011\-2013 Douglas Gilbert
 .br
 This software is distributed under a FreeBSD license. There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index 6e8ccc7..497425d 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -1,4 +1,4 @@
-.TH SG3_UTILS "8" "April 2013" "sg3_utils\-1.36" SG3_UTILS
+.TH SG3_UTILS "8" "May 2013" "sg3_utils\-1.36" SG3_UTILS
 .SH NAME
 sg3_utils \- a package of utilities for sending SCSI commands
 .SH SYNOPSIS
@@ -366,7 +366,7 @@
 given, multipliers cannot be used. For example the decimal value "256" can
 be given as "0x100" or "100h".
 .SH SCRIPTS, EXAMPLES and UTILS
-There are several Bourne shell scripts in the 'scripts' subdirectory that
+There are several bash shell scripts in the 'scripts' subdirectory that
 invoke compiled utilities (e.g. sg_readcap). The scripts start with 'scsi_'
 rather than 'sg_'. One purpose of these scripts is to call the same
 utility (e.g. sg_readcap) on multiple disks. Most of the basic compiled
diff --git a/ltmain.sh b/ltmain.sh
index 0096fe6..b9205ee 100755
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -70,7 +70,7 @@
 #         compiler:		$LTCC
 #         compiler flags:		$LTCFLAGS
 #         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
+#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1
 #         automake:	$automake_version
 #         autoconf:	$autoconf_version
 #
@@ -80,7 +80,7 @@
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
+VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1"
 TIMESTAMP=""
 package_revision=1.3337
 
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..c1bca85
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,42 @@
+
+if OS_LINUX
+
+bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+endif
+
+if OS_WIN32_MINGW
+
+bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+endif
+
+if OS_WIN32_CYGWIN
+
+bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+endif
+
+if OS_FREEBSD
+
+bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+endif
+
+if OS_SOLARIS
+
+bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+endif
+
+if OS_OSF
+
+bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+endif
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
new file mode 100644
index 0000000..8aa2ce1
--- /dev/null
+++ b/scripts/Makefile.in
@@ -0,0 +1,466 @@
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = scripts
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(bindir)"
+SCRIPTS = $(bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GETOPT_O_FILES = @GETOPT_O_FILES@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+os_libs = @os_libs@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+@OS_FREEBSD_TRUE@bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+@OS_FREEBSD_TRUE@	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+@OS_LINUX_TRUE@bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+@OS_LINUX_TRUE@	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+@OS_OSF_TRUE@bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+@OS_OSF_TRUE@	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+@OS_SOLARIS_TRUE@bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+@OS_SOLARIS_TRUE@	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+@OS_WIN32_CYGWIN_TRUE@bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+@OS_WIN32_CYGWIN_TRUE@	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+@OS_WIN32_MINGW_TRUE@bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+@OS_WIN32_MINGW_TRUE@	      scsi_satl scsi_start scsi_stop scsi_temperature
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu scripts/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	     } \
+	; done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	distclean distclean-generic distclean-libtool distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binSCRIPTS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	uninstall uninstall-am uninstall-binSCRIPTS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/scsi_mandat b/scripts/scsi_mandat
index dcf148c..1e9a701 100755
--- a/scripts/scsi_mandat
+++ b/scripts/scsi_mandat
@@ -50,14 +50,6 @@
   echo "Check <device> for manadatory SCSI command support"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi 
-
-# opt=$1
-# echo ${opt##-*}
 
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
@@ -75,6 +67,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi 
+
 for command in "sg_inq" "sg_luns" "sg_turs" "sg_requests" "sg_vpd" \
                 "sg_vpd -i" "sg_senddiag -t"
 do
diff --git a/scripts/scsi_readcap b/scripts/scsi_readcap
index 69ad8de..8f308f4 100755
--- a/scripts/scsi_readcap
+++ b/scripts/scsi_readcap
@@ -18,18 +18,12 @@
   echo "  where:"
   echo "    -b, --brief          output brief capacity data"
   echo "    -h, --help           print usage message"
-  echo "    -1, --long           send longer SCSI READ CAPACITY (16) cdb"
+  echo "    -l, --long           send longer SCSI READ CAPACITY (16) cdb"
   echo "    -v, --verbose        more verbose output"
   echo ""
   echo "Use SCSI READ CAPACITY command to fetch the size of each <device>"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi
-
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
   opt=${opt#-}
@@ -46,6 +40,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi
+
 for i
 do
 	if [ $brief ] ; then
diff --git a/scripts/scsi_ready b/scripts/scsi_ready
index 371efb7..724c2c6 100755
--- a/scripts/scsi_ready
+++ b/scripts/scsi_ready
@@ -23,12 +23,6 @@
   echo "Send SCSI TEST UNIT READY to each <device>"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi
-
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
   opt=${opt#-}
@@ -44,6 +38,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi
+
 for i
 do
 	if [ ! $brief ] ; then
diff --git a/scripts/scsi_satl b/scripts/scsi_satl
index abaa6fc..6099422 100755
--- a/scripts/scsi_satl
+++ b/scripts/scsi_satl
@@ -58,15 +58,6 @@
   echo "Check <device> for SCSI to ATA Translation Layer (SATL) support"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi 
-
-# opt=$1
-# echo ${opt##-*}
-
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
   opt=${opt#-}
@@ -81,6 +72,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi 
+
 for command in "sg_inq" "sg_vpd" "sg_vpd -p di" "sg_vpd -p ai" "sg_luns" \
                "sg_turs" "sg_requests -s" "sg_senddiag -t" "sg_modes -a" \
                "sg_sat_identify"
diff --git a/scripts/scsi_start b/scripts/scsi_start
index cad370a..aec7ab9 100755
--- a/scripts/scsi_start
+++ b/scripts/scsi_start
@@ -29,12 +29,6 @@
   echo "Send SCSI START STOP UNIT command to start each <device>"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi
-
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
   opt=${opt#-}
@@ -48,6 +42,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi
+
 for i
 do
 	echo "sg_start $immediate 1 $verbose $i"
diff --git a/scripts/scsi_stop b/scripts/scsi_stop
index a6c3d02..7680723 100755
--- a/scripts/scsi_stop
+++ b/scripts/scsi_stop
@@ -29,12 +29,6 @@
   echo "Send SCSI START STOP UNIT command to stop each <device>"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi
-
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
   opt=${opt#-}
@@ -48,6 +42,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi
+
 for i
 do
 # Use '-r' (read-only) otherwise using a block device node
diff --git a/scripts/scsi_temperature b/scripts/scsi_temperature
index 31080eb..f7d041c 100755
--- a/scripts/scsi_temperature
+++ b/scripts/scsi_temperature
@@ -20,12 +20,6 @@
   echo "Use SCSI LOG SENSE command to fetch temperature of each <device>"
 }
 
-if (( $# < 1 ))
-  then
-    usage
-    exit 1
-fi
-
 opt="$1"
 while test ! -z "$opt" -a -z "${opt##-*}"; do
   opt=${opt#-}
@@ -39,6 +33,12 @@
   opt="$1"
 done
 
+if [ $# -lt 1 ]
+  then
+    usage
+    exit 1
+fi
+
 for i
 do
 	echo "sg_logs -t $verbose $i"
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index ee92ade..00547ae 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -30,7 +30,7 @@
 
 */
 
-static const char * version_str = "0.66 20130507";    /* spc4r36 + sbc3r35 */
+static const char * version_str = "0.66 20130510";    /* spc4r36 + sbc3r35 */
         /* And with sbc3r35, vale Mark Evans */
 
 extern void svpd_enumerate_vendor(void);
@@ -1574,6 +1574,7 @@
         else {
             switch (proto) {
             case TPROTO_SAS:    /* for SSP, added spl3r2 */
+                printf(" pwr_d_s=%d\n", !!(ucp[3] & 0x1));
                 pidp = ucp + 8;
                 for (j = 0; j < desc_len; j += 4, pidp += 4)
                     printf("  phy id=%d, ssp persistent capable=%d\n",