-->

Issue passing valid command-line arguments for soc

2019-06-05 09:16发布

问题:

Whereas this works as expected:

root@LIM:~# socat -d -d pty pty
2017/10/15 01:01:49 socat[91] N PTY is /dev/pts/0
2017/10/15 01:01:49 socat[91] N PTY is /dev/pts/1
2017/10/15 01:01:49 socat[91] N starting data transfer loop with FDs [5,5] and [7,7]

Including any argument at all causes socat to fail:

root@LIM:~# socat -d -d pty,echo=0 pty
2017/10/15 01:04:56 socat[92] N PTY is /dev/pts/0
2017/10/15 01:04:56 socat[92] E tcsetattr(5, TCSADRAIN, 0x7fffdafe8be0): Invalid argument
2017/10/15 01:04:56 socat[92] N exit(1)

I'm following this SO advice, this tutorial, and this blog and ultimately want to run a command that may resemble socat -d -d pty,link=/dev/ttyS0,raw,echo=0 pty,link=/dev/ttyS1,raw,echo=0 to establish a pair of virtual serial ports for COM1 and COM2.

I am using Bash on Ubuntu on Windows:

root@LIM:~# socat -V
socat by Gerhard Rieger - see www.dest-unreach.org
socat version 1.7.3.1 on Feb  2 2016 21:25:06
   running on Linux version #1-Microsoft Wed Dec 31 14:42:53 PST 2014, release 4.4.0-43-Microsoft, machine x86_64
features:
#not shown for brevity

root@LIM:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

C:\Users\Aaron Borns>ver
Microsoft Windows [Version 10.0.15063]

What is wrong with the command to cause the Invalid argument error? Thank you for your help!