Bash type & ctrl-z keypress
I have a command for minicom, send SMS via modem with SSH / Putty, here is the command
AT^HCMGS="destination number"<press ENTER>
> SMS message <press CTRL + Z>
The command runs successfully with minicom
I want to ask how to simulate pressing ENTER and CTRL + Z in bash Can I write a script like this?
#!/bin/bash
echo -e -n "AT^HCMGS="888"(I don't know how to insert enter/return)" > /dev/ttyUSB0
echo -e -n "SMS message (I don't know how to insert ctrl+z)" > /dev/ttyUSB0
I want to integrate a program (motion linux) with this script in openWRT
Thank!
+3
source to share
2 answers
$ man skill
:
SYNOPSIS
skill [signal] [options] expression
PROCESS SELECTION OPTIONS
-t, --tty tty
The next expression is a terminal (tty or pty).
EXAMPLES
skill -KILL -t /dev/pts/*
Kill users on PTY devices.
So it should be something like (can't verify): skill -STOP --tty /dev/ttyUSB0
0
user4450405
source
to share