Bash Verständnissproblem

H

hwe

Grünschnabel
Hallo,
ich habe mir vor einigen Monaten folgende Notiz zum Test einer Null-Modem-Verbindung 2er Computer via Bash gemacht:

Serial Port Null Modem Test on Command Line
* You need 2 computers with serial ports to quickly test the serial data transmission.
* Connect the computers via a nullmodem cable (RX and TX is crossed)
* Make sure that the "/dev/ttyS0" device allows the user to read and write !
* On the receiving computer type in at the command line (ttyS0 is equal to COM1)
user:~$ TESTMSG < /dev/ttyS0
and wait ...
* On the transmitting computer type in at the command line
user:~$ echo 0023testmessage2323 > /dev/ttyS0
the message is sent to the receiving computer
* On the receiving computer the command line prompt should show up again, because the message was received, and read the message with
user:~$ echo $TESTMSG
0023testmessage2323

Das Problem ist, dass der erste Befehl user:~$ TESTMSG < /dev/ttyS0 anscheinend nicht mehr funktioniert. Es kommt die Fehlermeldung :
user:~$ TESTMSG < /dev/ttyS0
bash: TESTMSG: command not found

Ich seh einfach den Fehler nicht, könnt Ihr mir bitte Helfen?
(OS: DebianEtch)

Vielen Dank im Vorraus!
HWE
 
Hallo,
danke für die schnelle Antwort.
Das habe ich auch schon probiert, die Fehlermeldung ist zwar weg, aber der (die,das?) Prompt kommt sofort wieder

Code:
user:~$ $TESTMSG < /dev/ttyS0 
user:~$

Soweit ich mich erinnere ist der Prompt erst wieder gekommen, wenn die serielle Schnittstelle etwas empfangen hat.
Hast Du vielleicht noch eine Idee?
 
Sollte eigentlich genausowenig funktionieren a.b. ...
Code:
foo="echo hihi"
$foo    # gibt "hihi" aus, weil die variable durch echo hihi ersetzt wird..
Stattdessen versuchs doch mal mit read:
Code:
read foo < /dev/ttyS0
Aber kA, ich wundere mich eh, warum das bei dir vorher so funktioniert hat...
 
Vielen Dank !!!!!!!!!
Natürlich hab ich das "read" vergessen zu dokumentieren.

Jetzt funktionierts wieder.

Schönen Abend noch!
HWE
 

Ähnliche Themen

NGINX bietet intern abgerufene Seiten nur zum Download an, extern geht's

Nginx als Reverse Proxy für Nextcloud und Emby

Samba 3.6.25 - OpenLDAP Setup

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Email via script via Exchange Server (SASL)

Zurück
Oben