0

I'm using bash to script a remote dialing program in an Ubuntu(14.04) server and I am having some significant trouble trying to read the output from it. I would like the program to execute as I would normally have it and then I have the timeout command kill it, like so:

#!/usr/bash 

echo "begin"

timeout 60s minicom Cisco -d Boston >> log.txt

I am able to run the above command alone on the console without any sort of hiccups however when I run it through bash nothing really seems to happen, it goes through the timeout, but I just end up with these characters in log.txt:

^[[0m^O

I'm a bit green when it comes to scripting in bash; is there perhaps a rule about appending output from a graphical utility to output? I'm really quite confused as to why it is doing this.

rwaweber
  • 11
  • 1

1 Answers1

3

From man minicom

   -C, --capturefile=FILE
        filename.  Open capture file at startup.

So, simply do this:

#!/usr/bash 

echo "begin"

timeout 60s minicom Cisco -d Boston -C log.txt
moebius_eye
  • 1,092
  • 7
  • 21