How can we open minicom from current terminal and pass multiple commands to execute and exit to 1st terminal using shell script

user4348716

I am trying to write a shell script that creates a new window and run a minicom terminal (connected to /dev/ttyACM0) in that. Here's the script file my_script.sh:

#!/bin/bash
gnome-terminal --command minicom
echo "\n" >> /dev/ttyACM0
sleep 5
echo "\n" >> /dev/ttyACM0
echo "run x_boot" >> /dev/ttyACM0
sleep 5
echo "root" >> /dev/ttyACM0
sleep 3
echo "cd /tmp" >> /dev/ttyACM0
sleep 1

In the above code all the echo commands i'm passing directly to the device file not to the minicom terminal.

Requirements:

  1. Now I need to send command1 to minicom
  2. Make the terminal to sleep for 5 sec before sending next command
  3. Send Command2
  4. Wait again for 5sec.
  5. And many commands automated
  6. After that exit the terminal without closing minicom

Please help me with this.

Tomasz Myrta

Use minicom scripting (runscript) instead of bash echoes. It has both send and sleep commands:

-S, --script=SCRIPT    : run SCRIPT at startup

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to Open PDF in terminal using Shell Script?

From Dev

Open multiple terminal but without closing the previous one using shell script

From Dev

Execute multiple commands in a terminal window from bash

From Dev

How can I execute terminal commands from a C program?

From Dev

How to execute a shell script from within an .app, and show it in the Terminal?

From Dev

Python Execute Shell commands without having a terminal open

From Dev

Open multiple terminal tabs, execute commands and continue working on them

From Dev

Open multiple terminal tabs, execute commands and continue working on them

From Dev

Python syntax to open gnome-terminal and execute multiple commands

From Dev

How to Exit Linux terminal using Python script?

From Dev

Is there any way to execute a shell script whenever I open a terminal?

From Dev

On macOS, how do we remove the past commands history from Terminal > Shell > New Command?

From Dev

How to open a new Terminal with shell prompt and running multiple commands in Command Line?

From Dev

How to open a new Terminal with shell prompt and running multiple commands in Command Line?

From Dev

How to execute a command in the terminal from a Python script?

From Dev

Can a bash shell script open a text file with less and then execute less commands from the script?

From Dev

How to open a terminal from the terminal

From Dev

How to open a terminal from the terminal

From Dev

How to write a shell script using terminal?

From Dev

How to open terminal from terminal and run a program(script)?

From Dev

How to pass commands into the shell opened in new Windows Terminal

From Dev

How to execute commands in gnuplot using shell script?

From Dev

How can I make a script that opens terminal window, executes commands in it and remains open on Scientific Linux?

From Dev

How to pass input to a script from terminal?

From Dev

Open the terminal and execute commands via C programming

From Dev

Open Gnome Terminal window and execute 2 commands

From Dev

How to get into python environment and run some python commands and return to normal terminal using shell script

From Dev

How to execute multiple commands after opening a new terminal tab

From Dev

How to execute multiple commands after opening a new terminal tab

Related Related

  1. 1

    How to Open PDF in terminal using Shell Script?

  2. 2

    Open multiple terminal but without closing the previous one using shell script

  3. 3

    Execute multiple commands in a terminal window from bash

  4. 4

    How can I execute terminal commands from a C program?

  5. 5

    How to execute a shell script from within an .app, and show it in the Terminal?

  6. 6

    Python Execute Shell commands without having a terminal open

  7. 7

    Open multiple terminal tabs, execute commands and continue working on them

  8. 8

    Open multiple terminal tabs, execute commands and continue working on them

  9. 9

    Python syntax to open gnome-terminal and execute multiple commands

  10. 10

    How to Exit Linux terminal using Python script?

  11. 11

    Is there any way to execute a shell script whenever I open a terminal?

  12. 12

    On macOS, how do we remove the past commands history from Terminal > Shell > New Command?

  13. 13

    How to open a new Terminal with shell prompt and running multiple commands in Command Line?

  14. 14

    How to open a new Terminal with shell prompt and running multiple commands in Command Line?

  15. 15

    How to execute a command in the terminal from a Python script?

  16. 16

    Can a bash shell script open a text file with less and then execute less commands from the script?

  17. 17

    How to open a terminal from the terminal

  18. 18

    How to open a terminal from the terminal

  19. 19

    How to write a shell script using terminal?

  20. 20

    How to open terminal from terminal and run a program(script)?

  21. 21

    How to pass commands into the shell opened in new Windows Terminal

  22. 22

    How to execute commands in gnuplot using shell script?

  23. 23

    How can I make a script that opens terminal window, executes commands in it and remains open on Scientific Linux?

  24. 24

    How to pass input to a script from terminal?

  25. 25

    Open the terminal and execute commands via C programming

  26. 26

    Open Gnome Terminal window and execute 2 commands

  27. 27

    How to get into python environment and run some python commands and return to normal terminal using shell script

  28. 28

    How to execute multiple commands after opening a new terminal tab

  29. 29

    How to execute multiple commands after opening a new terminal tab

HotTag

Archive