+
+if ARGV.size < 5
+ STDERR.print <<EOF
+ Usage: ruby #{$0} port bps nbits stopb command [target_dir] [additional specifier]
+EOF
+ exit(1)
+end
+
+command=ARGV[4]+"\r";
+$dir=(ARGV.size>=6)?ARGV[5]:"";
+param=(ARGV.size>=7)?ARGV[6]:"";
+
+puts("\nPort: "+ARGV[0]+ "@"+ARGV[1]+" "+ARGV[2]+"N"+ARGV[3]+"\n");
+$linewidth = 16
+$sp = SerialPort.new(ARGV[0], ARGV[1].to_i, ARGV[2].to_i, ARGV[3].to_i, SerialPort::NONE);
+$sp.read_timeout=1000; # 1 second
+$extended_wait=10;
+$sp.write(command);
+